Class Printing
java.lang.Object
org.apache.pdfbox.examples.printing.Printing
Examples of various different ways to print PDFs using PDFBox.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidEntry point.private static voidprint(PDDocument document) Prints the document at its actual size.private static voidprintWithAttributes(PDDocument document) Prints using custom PrintRequestAttribute values.private static voidprintWithDialog(PDDocument document) Prints with a print preview dialog.private static voidprintWithDialogAndAttributes(PDDocument document) Prints with a print preview dialog and custom PrintRequestAttribute values.private static voidprintWithPaper(PDDocument document) Prints using a custom page size and custom margins.
-
Constructor Details
-
Printing
private Printing()
-
-
Method Details
-
main
Entry point.- Throws:
PrinterExceptionIOException
-
print
Prints the document at its actual size. This is the recommended way to print.- Throws:
PrinterException
-
printWithAttributes
Prints using custom PrintRequestAttribute values.- Throws:
PrinterException
-
printWithDialog
Prints with a print preview dialog.- Throws:
PrinterException
-
printWithDialogAndAttributes
Prints with a print preview dialog and custom PrintRequestAttribute values.- Throws:
PrinterException
-
printWithPaper
Prints using a custom page size and custom margins.- Throws:
PrinterException
-