Class Printing
- java.lang.Object
-
- org.apache.pdfbox.examples.printing.Printing
-
public final class Printing extends java.lang.ObjectExamples of various different ways to print PDFs using PDFBox.
-
-
Constructor Summary
Constructors Modifier Constructor Description privatePrinting()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)Entry 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.
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.awt.print.PrinterException, java.io.IOExceptionEntry point.- Throws:
java.awt.print.PrinterExceptionjava.io.IOException
-
print
private static void print(PDDocument document) throws java.awt.print.PrinterException
Prints the document at its actual size. This is the recommended way to print.- Throws:
java.awt.print.PrinterException
-
printWithAttributes
private static void printWithAttributes(PDDocument document) throws java.awt.print.PrinterException
Prints using custom PrintRequestAttribute values.- Throws:
java.awt.print.PrinterException
-
printWithDialog
private static void printWithDialog(PDDocument document) throws java.awt.print.PrinterException
Prints with a print preview dialog.- Throws:
java.awt.print.PrinterException
-
printWithDialogAndAttributes
private static void printWithDialogAndAttributes(PDDocument document) throws java.awt.print.PrinterException
Prints with a print preview dialog and custom PrintRequestAttribute values.- Throws:
java.awt.print.PrinterException
-
printWithPaper
private static void printWithPaper(PDDocument document) throws java.awt.print.PrinterException
Prints using a custom page size and custom margins.- Throws:
java.awt.print.PrinterException
-
-