Some test text!

menu
Print a documentkeyboard_arrow_down

Print a PDF to a printer in Java

To print a PDF to a default printer.

PDFDoc doc = new PDFDoc(filename);

// Setup PrinterMode options
PrinterMode printerMode = new PrinterMode();
printerMode.setCollation(true);
printerMode.setCopyCount(1);
printerMode.setDPI(600); // regardless of ordering, an explicit DPI setting overrides the OutputQuality setting
printerMode.setDuplexing(PrinterMode.e_Duplex_Auto);

// Print the document on the default printer, name the print job the name of the
// file, print to the printer not a file, and use printer options:
Print.startPrintJob(doc, "", doc.getFileName(), "", null, printerMode, null);

Print a PDF file
Full sample code which illustrates how to print a PDF document using the currently selected default printer.

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.