Package org.apache.pdfbox.tools
Class PrintPDF
java.lang.Object
org.apache.pdfbox.tools.PrintPDF
This is a command line program that will print a PDF document.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate intprivate PrintPDF.Duplexprivate Fileprivate Stringprivate booleanprivate booleanprivate Orientationprivate Stringprivate Stringprivate booleanprivate final PrintStreamprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()private PrintRequestAttributeSetcreatePrintRequestAttributeSet(PDDocument document) private static List<MediaSizeName> getMediaSizesFromPrintService(PrintService printService) getTraysFromPrintService(PrintService printService) static voidInfamous main method.private voidprivate AttributetoPossibleAlternateMedia(MediaTray mediaTray) Wraps the MediaTray object into a sun.print.SunAlternateMedia class if it exists.
-
Field Details
-
SYSERR
-
password
-
silentPrint
private boolean silentPrint -
printerName
-
orientation
-
duplex
-
tray
-
mediaSize
-
border
private boolean border -
dpi
private int dpi -
noCenter
private boolean noCenter -
noColorOpt
private boolean noColorOpt -
infile
-
-
Constructor Details
-
PrintPDF
public PrintPDF()Constructor.
-
-
Method Details
-
main
Infamous main method.- Parameters:
args- Command line arguments, should be one and a reference to a file.
-
call
-
getTraysFromPrintService
-
getMediaSizesFromPrintService
-
createPrintRequestAttributeSet
-
toPossibleAlternateMedia
Wraps the MediaTray object into a sun.print.SunAlternateMedia class if it exists. This allows to select both tray and paper size when printing.- Parameters:
mediaTray- a MediaTray object.- Returns:
- a wrapped MediaTray object or the original MediaTray object.
-
showAvailablePrinters
private void showAvailablePrinters()
-