Some test text!

menu
Print a documentkeyboard_arrow_down

Print a PDF to a printer in Go

To print a PDF to a default printer.

doc := NewPDFDoc(filename)

// Set our PrinterMode options
printerMode := NewPrinterMode()
printerMode.SetCollation(true)
printerMode.SetCopyCount(1)
printerMode.SetDPI(100); // regardless of ordering, an explicit DPI setting overrides the OutputQuality setting
printerMode.SetDuplexing(PrinterModeE_Duplex_Auto)

// Print the PDF document to the default printer, using "tiger.pdf" as the document
// name, send the file to the printer not to an output file, print all pages, set the printerMode
// and a cancel flag to true
pageSet := NewPageSet(1, doc.GetPageCount())
boolValue := true
PrintStartPrintJob(doc, "", doc.GetFileName(), "", pageSet, printerMode, &boolValue)

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.