cete.dynamicpdf.printing.printjob
PrintJob
- Namespace: ceTe.DynamicPDF.Printing
- Assemblies: DynamicPDF.Printing.dll
Represents a job that can be sent to a printer.
public class PrintJob : IDisposable
Public Class PrintJob
Implements IDisposable
Inheritance: Object → PrintJob
Implements: IDisposable
Derived: FaxPrintJob
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 and prints the job.
Imports System
Imports ceTe.DynamicPDF.Printing
Module MyModule
Sub Main()
' Create a print job containing the first four pages of the PDF
Dim MyPrintJob As PrintJob = New PrintJob("PrinterName", "C:\MyDocument.pdf", 1, 4)
' Print the job
MyPrintJob.Print()
End Sub
End Module
using System;
using ceTe.DynamicPDF.Printing;
class MyClass
{
static void Main()
{
// Create a print job containing the first four pages of the PDF
PrintJob printJob = new PrintJob("PrinterName", @"C:\MyDocument.pdf", 1, 4);
// Print the job
printJob.Print();
}
}
Remarks
Events in this class may not fire if specified printer or network does not support communicating back.
Constructors
PrintJob(Printer)
Initializes a new instance of the PrintJob class.
public PrintJob(Printer printer)
Public Sub New (printer As Printer)
Parameters
- printer: Printer
The Printer object targeted by the print job.
Licensing Info
This constructor 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.
PrintJob(Printer, InputPdf)
Initializes a new instance of the PrintJob class.
public PrintJob(Printer printer, InputPdf inputPdf)
Public Sub New (printer As Printer, inputPdf As InputPdf)
Parameters
- printer: Printer
The Printer object targeted by the print job.
- inputPdf: InputPdf
The InputPdf object containing the pages to be added to the print job.
Licensing Info
This constructor 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.
PrintJob(Printer, InputPdf, Int32, Int32)
Initializes a new instance of the PrintJob class.
public PrintJob(Printer printer, InputPdf inputPdf, int startPage, int pageCount)
Public Sub New (printer As Printer, inputPdf As InputPdf, startPage As Integer, pageCount As Integer)
Parameters
- printer: Printer
The Printer object targeted by the print job.
- inputPdf: InputPdf
The InputPdf object containing the pages to be added to the print job.
- startPage: Int32
The first page from the InputPdf to be added to the print job.
- pageCount: Int32
The number of pages to be added to the print job.
Licensing Info
This constructor 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.
PrintJob(Printer, String)
Initializes a new instance of the PrintJob class.
public PrintJob(Printer printer, string pdfFileName)
Public Sub New (printer As Printer, pdfFileName As String)
Parameters
- printer: Printer
The Printer object targeted by the print job.
- pdfFileName: String
The file path to the PDF containing the pages to be added to the print job.
Licensing Info
This constructor 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.
PrintJob(Printer, String, Int32, Int32)
Initializes a new instance of the PrintJob class.
public PrintJob(Printer printer, string pdfFileName, int startPage, int pageCount)
Public Sub New (printer As Printer, pdfFileName As String, startPage As Integer, pageCount As Integer)
Parameters
- printer: Printer
The Printer object targeted by the print job.
- pdfFileName: String
The file path to the PDF containing the pages to be added to the print job.
- startPage: Int32
The first page from the InputPdf to be added to the print job.
- pageCount: Int32
The number of pages to be added to the print job.
Licensing Info
This constructor 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.
PrintJob(String)
Initializes a new instance of the PrintJob class.
public PrintJob(string printerName)
Public Sub New (printerName As String)
Parameters
- printerName: String
The name of the printer targeted by the print job.
Licensing Info
This constructor 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.
PrintJob(String, InputPdf)
Initializes a new instance of the PrintJob class.
public PrintJob(string printerName, InputPdf inputPdf)
Public Sub New (printerName As String, inputPdf As InputPdf)
Parameters
- printerName: String
The name of the printer targeted by the print job.
- inputPdf: InputPdf
The InputPdf object containing the pages to be added to the print job.
Licensing Info
This constructor 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.
PrintJob(String, InputPdf, Int32, Int32)
Initializes a new instance of the PrintJob class.
public PrintJob(string printerName, InputPdf inputPdf, int startPage, int pageCount)
Public Sub New (printerName As String, inputPdf As InputPdf, startPage As Integer, pageCount As Integer)
Parameters
- printerName: String
The name of the printer targeted by the print job.
- inputPdf: InputPdf
The InputPdf object containing the pages to be added to the print job.
- startPage: Int32
The first page from the InputPdf to be added to the print job.
- pageCount: Int32
The number of pages to be added to the print job.
Licensing Info
This constructor 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.
PrintJob(String, String)
Initializes a new instance of the PrintJob class.
public PrintJob(string printerName, string pdfFileName)
Public Sub New (printerName As String, pdfFileName As String)
Parameters
- printerName: String
The name of the printer targeted by the print job.
- pdfFileName: String
The file path to the PDF containing the pages to be added to the print job.
Licensing Info
This constructor 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.
PrintJob(String, String, Int32, Int32)
Initializes a new instance of the PrintJob class.
public PrintJob(string printerName, string pdfFileName, int startPage, int pageCount)
Public Sub New (printerName As String, pdfFileName As String, startPage As Integer, pageCount As Integer)
Parameters
- printerName: String
The name of the printer targeted by the print job.
- pdfFileName: String
The file path to the PDF containing the pages to be added to the print job.
- startPage: Int32
The first page from the InputPdf to be added to the print job.
- pageCount: Int32
The number of pages to be added to the print job.
Licensing Info
This constructor 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.
Properties
DocumentName
Gets or sets the name of the document that is to be shown in the print spooler.
public string DocumentName { get; set; }
Public Property DocumentName As String
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.
JobId
Gets the ID of the job.
public int JobId { get; }
Public Property JobId 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.
Logging
Gets or sets the Temporary directory path.
public static LogConfig Logging { get; }
Public Shared Property Logging As LogConfig
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.
Examples
This example shows how to use the TemporaryDirectory property.
Imports ceTe.DynamicPDF.Printing
Module Module1
Sub Main()
' Assign level of logging to log config.
PrintJob.Logging.Level = LogLevel.Warning
' Create a print job containing the first four pages of the PDF
Dim MyPrintJob As PrintJob = New PrintJob("PrinterName", "C:\MyDocument.pdf", 1, 4)
' Print the job
MyPrintJob.Print()
End Sub
End Module
using System;
using ceTe.DynamicPDF.Printing;
class MyClass
{
static void Main()
{
//Assign level of logging to log config.
PrintJob.Logging.Level = LogLevel.Warning;
// Create a print job containing the first four pages of the PDF
PrintJob printJob = new PrintJob("PrinterName", @"C:\MyDocument.pdf", 1, 4);
// Print the job
printJob.Print();
}
}
Pages
Gets a PrintJobPageList object that represents the pages to be printed by the job.
public PrintJobPageList Pages { get; }
Public Property Pages As PrintJobPageList
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.
PagesPrinted
Gets a value indicating how many pages have been printed.
public int PagesPrinted { get; }
Public Property PagesPrinted 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.
Remarks
This property is dependent on the printer driver to update the value. It is not generally accurate when printing to network printers.
Printer
Gets the Printer object that is targeted by the job.
public Printer Printer { get; }
Public Property Printer As Printer
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.
PrintOptions
Gets a PrintJobPrintOptions objects that represents the printing options for the job.
public PrintJobPrintOptions PrintOptions { get; }
Public Property PrintOptions As PrintJobPrintOptions
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.
PrintPriority
Gets or sets the Print priority of print job. Enter the value in between the Range(1 - 99).
public int PrintPriority { get; set; }
Public Property PrintPriority 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.
PrintToFileName
Gets or sets the filename or path where the output will be saved.
public string PrintToFileName { get; set; }
Public Property PrintToFileName As String
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.
Remarks
If this property is set with a valid filename, raw printer data will be saved instead of actual printing.
RawStatus
RawStatus represents the status as returned by the printer driver. It may have multiple bits set at the same time which means it can represent multiple values from the PrintJobStatus enumeration.
public PrintJobStatus RawStatus { get; }
Public Property RawStatus As PrintJobStatus
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.
Status
Gets the current status of the job.
public PrintJobStatus Status { get; }
Public Property Status As PrintJobStatus
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
AddLicense(String)
Adds a license key.
public static bool AddLicense(string licenseKey)
Shared Function AddLicense(licenseKey As String) As Boolean
Parameters
- licenseKey: String
The license key to add.
Returns
A boolean value indicating if the license key is valid.
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
This method accepts a license key, not a serial number.
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.
Print()
Prints the job to the printer.
public void Print()
Sub Print()
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.
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.
Events
Failed
Occurs when a job fails.
public event PrintJobFailedEventHandler PrintJob.Failed;
Public Event PrintJob.Failed As PrintJobFailedEventHandler
Event Handler
Licensing Info
This event 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.
Starting
Occurs before starting a job.
public event PrintJobStartingEventHandler PrintJob.Starting;
Public Event PrintJob.Starting As PrintJobStartingEventHandler
Event Handler
Licensing Info
This event 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.
Succeeded
Occurs when a job succeeds.
public event PrintJobEventHandler PrintJob.Succeeded;
Public Event PrintJob.Succeeded As PrintJobEventHandler
Event Handler
Licensing Info
This event 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.
Updated
Occurs when a job's status or pages printed is updated.
public event PrintJobEventHandler PrintJob.Updated;
Public Event PrintJob.Updated As PrintJobEventHandler
Event Handler
Licensing Info
This event 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.