Some test text!

Discord Logo

Chat with us

PDFTron is now Apryse, learn more here.

Cpp / Guides / Print a document


PDFTron is now Apryse, learn more here.

Print a PDF to a printer in C++

To print a PDF to a default printer.

PDFDoc doc(filename);

// Setup PrinterMode options
PrinterMode printerMode;
printerMode.SetDPI(600); // regardless of ordering, an explicit DPI setting overrides the OutputQuality setting

// 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, UString(""), doc.GetFileName(), UString(""), 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