Skip to main content

PrintJobPrintOptions

Version: 1.0

cete.dynamicpdf.printing.printjobprintoptions

PrintJobPrintOptions​

  • Namespace: ceTe.DynamicPDF.Printing
  • Assemblies: ceTe.DynamicPDF.Printing.40.x64.dll, ceTe.DynamicPDF.Printing.40.x86.dll

Represents the printing options for a job.

public class PrintJobPrintOptions : IDisposable
Public Class PrintJobPrintOptions
Implements IDisposable

Inheritance: Object → PrintJobPrintOptions

Implements: IDisposable

Examples​

The following examples creates a print job, sets print options and prints the job.

Imports System
Imports ceTe.DynamicPDF.Printing

Module MyModule

Sub Main()

' Create a print job
Dim MyPrintJob As PrintJob = New PrintJob("PrinterName", "C:\MyDocument.pdf")

' Set all the print options
If (MyPrintJob.Printer.Color) Then ' If the printer supports color printing
MyPrintJob.PrintOptions.Color = True
End If
If (MyPrintJob.Printer.Duplex) Then ' If the printer supports duplex printing
MyPrintJob.PrintOptions.DuplexMode = DuplexMode.DuplexVertical
End If
MyPrintJob.PrintOptions.Copies = 1
MyPrintJob.PrintOptions.HorizontalAlign = HorizontalAlign.Left
MyPrintJob.PrintOptions.PrintAnnotations = False
MyPrintJob.PrintOptions.Scaling = PageScaling.ActualSize
MyPrintJob.PrintOptions.SetPaperSizeByName("Legal")
MyPrintJob.PrintOptions.SetPaperSourceByName("Tray 2")
MyPrintJob.PrintOptions.SetResolutionByDpi(300)
MyPrintJob.PrintOptions.VerticalAlign = VerticalAlign.Top

' Print the job
MyPrintJob.Print()
End Sub
End Module
using System;
using ceTe.DynamicPDF.Printing;

class MyClass
{
static void Main()
{
// Create a print job
PrintJob printJob = new PrintJob("PrinterName", @"C:\MyDocument.pdf");

// Set all the print options
if (printJob.Printer.Color) // If the printer supports color printing
{
printJob.PrintOptions.Color = true;
}
if (printJob.Printer.Duplex) // If the printer supports duplex printing
{
printJob.PrintOptions.DuplexMode = DuplexMode.DuplexVertical;
}
printJob.PrintOptions.Copies = 1;
printJob.PrintOptions.HorizontalAlign = HorizontalAlign.Left;
printJob.PrintOptions.PrintAnnotations = false;
printJob.PrintOptions.Scaling = PageScaling.ActualSize;
printJob.PrintOptions.SetPaperSizeByName("Legal");
printJob.PrintOptions.SetPaperSourceByName("Tray 2");
printJob.PrintOptions.SetResolutionByDpi(300);
printJob.PrintOptions.VerticalAlign = VerticalAlign.Top;

// Print the job
printJob.Print();
}
}

Properties​

Collate​

Gets or sets a value indicating if the job's copies should be collated.

public bool Collate { get; set; }
Public Property Collate As Boolean

Property Value​

Boolean

Color​

Gets or sets a value indicating if the job should printed in color.

public bool Color { get; set; }
Public Property Color As Boolean

Property Value​

Boolean

Copies​

Gets or sets a value indicating the number of copies to print.

public int Copies { get; set; }
Public Property Copies As Int32

Property Value​

Int32

DuplexMode​

Gets or sets a value indicating the duplex mode to use when printing the pages.

public DuplexMode DuplexMode { get; set; }
Public Property DuplexMode As DuplexMode

Property Value​

DuplexMode

HorizontalAlign​

Gets or sets a value indicating the horizontal alignment to use when printing the pages.

public HorizontalAlign HorizontalAlign { get; set; }
Public Property HorizontalAlign As HorizontalAlign

Property Value​

HorizontalAlign

Orientation​

Gets a value indicating the orientation to use when printing the pages.

public PageOrientation Orientation { get; set; }
Public Property Orientation As PageOrientation

Property Value​

PageOrientation

PaperSize​

Gets or sets a value indicating the size of paper to use when printing the pages.

public PaperSize PaperSize { get; set; }
Public Property PaperSize As PaperSize

Property Value​

PaperSize

PaperSource​

Gets or sets a value indicating the paper source (tray) to use when printing.

public PaperSource PaperSource { get; set; }
Public Property PaperSource As PaperSource

Property Value​

PaperSource

PrintAnnotations​

Gets or sets a value indicating if annotations from the PDF should be printed.

public bool PrintAnnotations { get; set; }
Public Property PrintAnnotations As Boolean

Property Value​

Boolean

Resolution​

Gets or sets a value indicating the resolution to use when printing.

public Resolution Resolution { get; set; }
Public Property Resolution As Resolution

Property Value​

Resolution

Scaling​

Gets or sets a value indicating the page scaling to use when printing the pages.

public PageScaling Scaling { get; set; }
Public Property Scaling As PageScaling

Property Value​

PageScaling

VerticalAlign​

Gets or sets a value indicating the vertical alignment to use when printing the pages.

public VerticalAlign VerticalAlign { get; set; }
Public Property VerticalAlign As VerticalAlign

Property Value​

VerticalAlign

Methods​

Dispose()​

Releases resources used by the PrintJobPrintOptions object.

public void Dispose()
Sub Dispose()

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

SetPaperSizeByName(String)​

Sets the size of paper to use based on its name.

public bool SetPaperSizeByName(string name)
Function SetPaperSizeByName(name As String) As Boolean

Parameters​

The name of the paper size to set.

Returns​

A boolean value indicating if the paper size name is valid for this printer.

Remarks​

If the specified paper size is not supported by the printer, the paper size will not be changed and this method will return false.

SetPaperSourceByName(String)​

Sets the paper source (tray) to use based on its name.

public bool SetPaperSourceByName(string name)
Function SetPaperSourceByName(name As String) As Boolean

Parameters​

The name of the paper source (tray) to set.

Returns​

A boolean value indicating if the paper source (tray) name is valid for this printer.

Remarks​

If the specified paper source (tray) is not supported by the printer, the paper source (tray) will not be changed and this method will return false.

SetResolutionByDpi(Int32)​

Sets the resolution to use based on its DPI.

public bool SetResolutionByDpi(int dpi)
Function SetResolutionByDpi(dpi As Integer) As Boolean

Parameters​

The horizontal and vertical DPI to set.

Returns​

A boolean value indicating if the DPI is valid for this printer.

Remarks​

If the specified DPI is not supported by the printer, the DPI will not be changed and this method will return false.

SetResolutionByDpi(Int32, Int32)​

Sets the resolution to use based on its DPI.

public bool SetResolutionByDpi(int horizontalDpi, int verticalDpi)
Function SetResolutionByDpi(horizontalDpi As Integer, verticalDpi As Integer) As Boolean

Parameters​

The horizontal DPI to set.

The vertical DPI to set.

Returns​

A boolean value indicating if the DPI is valid for this printer.

Remarks​

If the specified DPI is not supported by the printer, the DPI will not be changed and this method will return false.

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF.Printing