Skip to main content

PrintJob

Version: 2.0

cete.dynamicpdf.printing.printjob

PrintJob​

  • Namespace: ceTe.DynamicPDF.Printing
  • Assemblies: ceTe.DynamicPDF.Printing.40.x64.dll, ceTe.DynamicPDF.Printing.40.x86.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​

This class is a DynamicPDF PrintManager feature. The following license is required for non-evaluation usage:

  • DynamicPDF PrintManager for .NET

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();
}
}

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

JobId​

Gets the ID of the job.

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

Property Value​

Int32

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

PagesPrinted​

Gets a value indicating how many pages have been printed.

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

Property Value​

Int32

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

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

PrintToFileName​

public string PrintToFileName { get; set; }
Public Property PrintToFileName As String

Property Value​

String

Status​

Gets the current status of the job.

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

Property Value​

PrintJobStatus

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.

Remarks​

This method accepts a license key, not a serial number.

Dispose()​

Releases resources used by the PrintJob 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.

Print()​

Prints the job to the printer.

public void Print()
Sub Print()

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 .

Events​

Failed​

Occurs when a job fails.

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

Event Handler​

PrintJobFailedEventHandler

Starting​

Occurs before starting a job.

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

Event Handler​

PrintJobStartingEventHandler

Succeeded​

Occurs when a job succeeds.

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

Event Handler​

PrintJobEventHandler

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

See Also​

ceTe.DynamicPDF.Printing