cete.dynamicpdf.printing.printjobprintoptions
PrintJobPrintOptions
- Namespace: ceTe.DynamicPDF.Printing
- Assemblies: DynamicPDF.Printing.dll
Represents the printing options for a job.
public class PrintJobPrintOptions : IDisposable
Public Class PrintJobPrintOptions
Implements IDisposable
Inheritance: Object → PrintJobPrintOptions
Implements: IDisposable
Licensing Info
This class is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
MediaType
Gets or sets a value indicating the media type to use when printing.
public MediaType MediaType { get; set; }
Public Property MediaType As MediaType
Property Value
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
Licensing Info
This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Methods
Dispose()
Clean up any resources being used.
public void Dispose()
Sub Dispose()
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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 .
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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.
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
SetMediaTypeByName(String)
Sets the media type to use based on its name.
public bool SetMediaTypeByName(string name)
Function SetMediaTypeByName(name As String) As Boolean
Parameters
- name: String
The name of the media type to set.
Returns
A boolean value indicating if the media type name is valid for this printer.
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
Remarks
If the specified media type is not supported by the printer, the media type will not be changed and this method will return false.
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
- name: String
The name of the paper size to set.
Returns
A boolean value indicating if the paper size name is valid for this printer.
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
- name: String
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.
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
- dpi: Int32
The horizontal and vertical DPI to set.
Returns
A boolean value indicating if the DPI is valid for this printer.
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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
- horizontalDpi: Int32
The horizontal DPI to set.
- verticalDpi: Int32
The vertical DPI to set.
Returns
A boolean value indicating if the DPI is valid for this printer.
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.
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 .
Licensing Info
This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF PrintManager selected.
- A DynamicPDF PrintManager for .NET v4.X Developer license.