Class Print
Print is a utility class for printing PDF documents to printers.
Implements
Inherited Members
Namespace: pdftron.PDF
Assembly: PDFNet.dll
Syntax
public class Print : IDisposable
Methods
Dispose()
Releases all resources used by the Print
Declaration
public override sealed void Dispose()
Dispose(bool)
Declaration
[HandleProcessCorruptedStateExceptions]
protected virtual void Dispose(bool A_0)
Parameters
Type | Name | Description |
---|---|---|
bool | A_0 |
~Print()
Declaration
protected ~Print()
StartPrintJob(PDFDoc, string, string, string, PageSet, PrinterMode, Context)
Print the PDFDoc to a printer. Depending on the OS and installed libraries, the PDFDoc will be sent using the GDI or the XPS print path. This function will block until the print job is done at the OS level.
Declaration
public static void StartPrintJob(PDFDoc in_pdfdoc, string in_printerName, string in_jobName, string in_outputFileName, PageSet in_pagesToPrint, PrinterMode in_printerMode, Context in_ctx)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | in_pdfdoc | the in_doc |
string | in_printerName | the name of the printer to print to |
string | in_jobName | the name of the job for print queue monitoring, can be empty. |
string | in_outputFileName | if not empty, the name of the output file to save the printout into. This could be a PostScript, PCL, XPS or other file. |
PageSet | in_pagesToPrint | a PageSet defining which pages should be printed in the document. |
PrinterMode | in_printerMode | options for the printer. |
Context | in_ctx | (Optional) Optional Content Group setting, for example from PDFViewCtrl.GetOCGContext. |
Remarks
If the printer is grayscale, only grayscale data will be sent.
Examples
printer options example usage:
PrinterMode printerMode = new PrinterMode();
printerMode.PutNumber("CopyCount", 1); // must be greater than zero
printerMode.PutBool("Collation", true); // true or false
// duplexing: {e_DuplexAuto, e_Duplex_None, e_Duplex_LongSide, e_Duplex_ShortSide}
printerMode.PutNumber("Duplexing", PrinterMode::e_Duplex_Auto);
// output quality: {e_OutputQuality_Draft, e_OutputQuality_Low, e_OutputQuality_Medium, e_OutputQuality_High}
printerMode.PutNumber("OutputQuality", PrinterMode::e_OutputQuality_Medium);
// output color: {e_OutputColor_Color, e_OutputColor_Grayscale, e_OutputColor_Monochrome}
printerMode.PutNumber("OutputColor", PrinterMode::e_OutputColor_Grayscale);
printerMode.PutNumber("DPI", 300); // this will override e_PrintQuality_Medium setting