public class

Print

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.Print

Class Overview

Print is a utility class used to print PDF documents.

Summary

Public Constructors
Print()
Public Methods
static void startPrintJob(PDFDoc in_doc, String in_printerName, String in_jobName, String in_outputFileName, PageSet in_pagesToPrint, PrinterMode in_printerMode, Context in_ctx)
(Windows Only) Print the PDFDoc to a printer.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Print ()

Public Methods

public static void startPrintJob (PDFDoc in_doc, String in_printerName, String in_jobName, String in_outputFileName, PageSet in_pagesToPrint, PrinterMode in_printerMode, Context in_ctx)

(Windows Only) 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.

Note: If the printer is grayscale, only grayscale data will be sent.

Throws a trn::Common::Exception on failure.

acquires a write lock on the document

Parameters
in_doc the document to print
in_printerName the name of the printer to print to
in_jobName the name of the job for print queue monitoring, can be empty.
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.
in_pagesToPrint a PageSet defining which pages should be printed in the document.
in_printerMode options for the printer, 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 }
in_ctx (Optional) Optional Content Group setting, for example from PDFViewCtrl.getOCGContext.