Skip to main content

PrintJob

Version: 4.0

cete.dynamicpdf.printing.printjob

PrintJob​

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:

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​

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:

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​

The Printer object targeted by the print job.

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:

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​

The Printer object targeted by the print job.

The InputPdf object containing the pages to be added to the print job.

The first page from the InputPdf to be added to the print job.

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:

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​

The Printer object targeted by the print job.

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:

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​

The Printer object targeted by the print job.

The file path to the PDF containing the pages to be added to the print job.

The first page from the InputPdf to be added to the print job.

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:

PrintJob(String)​

Initializes a new instance of the PrintJob class.

public PrintJob(string printerName)
Public Sub New (printerName As String)

Parameters​

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:

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​

The name of the printer targeted by the print job.

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:

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​

The name of the printer targeted by the print job.

The InputPdf object containing the pages to be added to the print job.

The first page from the InputPdf to be added to the print job.

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:

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​

The name of the printer targeted by the print job.

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:

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​

The name of the printer targeted by the print job.

The file path to the PDF containing the pages to be added to the print job.

The first page from the InputPdf to be added to the print job.

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:

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​

String

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

JobId​

Gets the ID of the job.

public int JobId { get; }
Public Property JobId As Int32

Property Value​

Int32

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

Logging​

Gets or sets the Temporary directory path.

public static LogConfig Logging { get; }
Public Shared Property Logging As LogConfig

Property Value​

LogConfig

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

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​

PrintJobPageList

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

PagesPrinted​

Gets a value indicating how many pages have been printed.

public int PagesPrinted { get; }
Public Property PagesPrinted As Int32

Property Value​

Int32

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

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​

Printer

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

PrintOptions​

Gets a PrintJobPrintOptions objects that represents the printing options for the job.

public PrintJobPrintOptions PrintOptions { get; }
Public Property PrintOptions As PrintJobPrintOptions

Property Value​

PrintJobPrintOptions

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

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​

Int32

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

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​

String

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

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​

PrintJobStatus

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

Status​

Gets the current status of the job.

public PrintJobStatus Status { get; }
Public Property Status As PrintJobStatus

Property Value​

PrintJobStatus

Licensing Info​

This property is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

Methods​

AddLicense(String)​

Adds a license key.

public static bool AddLicense(string licenseKey)
Shared Function AddLicense(licenseKey As String) As Boolean

Parameters​

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:

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:

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.

Licensing Info​

This method is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

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:

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:

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:

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:

Events​

Failed​

Occurs when a job fails.

public event PrintJobFailedEventHandler PrintJob.Failed;
Public Event PrintJob.Failed As PrintJobFailedEventHandler

Event Handler​

PrintJobFailedEventHandler

Licensing Info​

This event is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

Starting​

Occurs before starting a job.

public event PrintJobStartingEventHandler PrintJob.Starting;
Public Event PrintJob.Starting As PrintJobStartingEventHandler

Event Handler​

PrintJobStartingEventHandler

Licensing Info​

This event is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

Succeeded​

Occurs when a job succeeds.

public event PrintJobEventHandler PrintJob.Succeeded;
Public Event PrintJob.Succeeded As PrintJobEventHandler

Event Handler​

PrintJobEventHandler

Licensing Info​

This event is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

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​

PrintJobEventHandler

Licensing Info​

This event is a DynamicPDF PrintManager feature. One of the following is required for non-evaluation usage:

See Also​

ceTe.DynamicPDF.Printing