public class PDFPrinter extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
PDFPrinter.PDFPageable |
protected class |
PDFPrinter.PDFPrintable |
| Modifier and Type | Field and Description |
|---|---|
protected PDDocument |
document |
protected float |
dpi |
protected Orientation |
orientation |
protected Paper |
paper |
protected PrinterJob |
printerJob |
protected PDFRenderer |
renderer |
protected Scaling |
scaling |
protected boolean |
showPageBorder |
| Constructor and Description |
|---|
PDFPrinter(PDDocument document)
Creates a new PDFPrinter using the system's default printer.
|
PDFPrinter(PDDocument document,
PrinterJob printerJob)
Creates a new PDFPrinter using the given printer.
|
PDFPrinter(PDDocument document,
PrinterJob printerJob,
Scaling scaling,
Orientation orientation,
Paper paper,
boolean showPageBorder,
float dpi)
Creates a new PDFPrinter using the given printer, the given page scaling and orientation,
and with optional page borders shown.
|
PDFPrinter(PDDocument document,
Scaling scaling,
Orientation orientation)
Creates a new PDFPrinter using the system's default printer,
with the given page scaling and orientation.
|
PDFPrinter(PDDocument document,
Scaling scaling,
Orientation orientation,
Paper paper)
Creates a new PDFPrinter using the system's default printer,
with the given page scaling and orientation.
|
PDFPrinter(PDDocument document,
Scaling scaling,
Orientation orientation,
Paper paper,
float dpi)
Creates a new PDFPrinter using the system's default printer,
with the given page scaling and orientation.
|
| Modifier and Type | Method and Description |
|---|---|
Pageable |
getPageable()
Returns the Pageable instance used in this class.
|
boolean |
print()
Prints the given document using the default printer without prompting the user.
|
boolean |
print(PrinterJob printerJob)
Prints the given document using the default printer without prompting the user.
|
boolean |
print(PrinterJob printerJob,
PrintRequestAttributeSet attributes)
Prints the given document using the default printer without prompting the user.
|
boolean |
print(PrintRequestAttributeSet attributes)
Prints the given document using the default printer without prompting the user.
|
void |
silentPrint()
Prints the given document using the default printer without prompting the user.
|
void |
silentPrint(PrinterJob printerJob)
Prints the given document using the default printer without prompting the user.
|
boolean |
silentPrint(PrintRequestAttributeSet attributes)
Prints the given document using the default printer without prompting the user.
|
protected final PDDocument document
protected final PDFRenderer renderer
protected final PrinterJob printerJob
protected final Scaling scaling
protected final Orientation orientation
protected final boolean showPageBorder
protected final Paper paper
protected final float dpi
public PDFPrinter(PDDocument document) throws PrinterException
document - the document to printPrinterException - if the document permissions don't allow printingpublic PDFPrinter(PDDocument document, PrinterJob printerJob) throws PrinterException
document - the document to printprinterJob - the printer job to usePrinterException - if the document permissions don't allow printingpublic PDFPrinter(PDDocument document, Scaling scaling, Orientation orientation) throws PrinterException
document - the document to printscaling - page scaling policyorientation - page orientation policyPrinterException - if the document permissions don't allow printingpublic PDFPrinter(PDDocument document, Scaling scaling, Orientation orientation, Paper paper) throws PrinterException
document - the document to printscaling - page scaling policyorientation - page orientation policypaper - the physical characteristics of a piece of paperPrinterException - if the document permissions don't allow printingpublic PDFPrinter(PDDocument document, Scaling scaling, Orientation orientation, Paper paper, float dpi) throws PrinterException
document - the document to printscaling - page scaling policyorientation - page orientation policypaper - the physical characteristics of a piece of paperdpi - if non-zero then the image will be rasterized at the given DPIPrinterException - if the document permissions don't allow printingpublic PDFPrinter(PDDocument document, PrinterJob printerJob, Scaling scaling, Orientation orientation, Paper paper, boolean showPageBorder, float dpi) throws PrinterException
document - the document to printprinterJob - the printer job to usescaling - page scaling policyorientation - page orientation policypaper - the physical characteristics of a piece of papershowPageBorder - true if page borders are to be printeddpi - if non-zero then the image will be rasterized at the given DPIPrinterException - if the document permissions don't allow printingpublic void silentPrint()
throws PrinterException
PrinterException - if the document cannot be printedpublic boolean silentPrint(PrintRequestAttributeSet attributes) throws PrinterException
attributes - application supplied attributesPrinterException - if the document cannot be printedpublic void silentPrint(PrinterJob printerJob) throws PrinterException
printerJob - a printer job definitionPrinterException - if the document cannot be printedpublic boolean print()
throws PrinterException
PageDrawer.
This is a convenience method to create the java.awt.print.PrinterJob.
Advanced printing tasks can be performed using getPageable() instead.PrinterException - if the document cannot be printedpublic boolean print(PrintRequestAttributeSet attributes) throws PrinterException
PageDrawer.
This is a convenience method to create the java.awt.print.PrinterJob.
Advanced printing tasks can be performed using getPageable() instead.attributes - application supplied attributesPrinterException - if the document cannot be printedpublic boolean print(PrinterJob printerJob) throws PrinterException
printerJob - the printer job.PrinterException - if the document cannot be printedpublic boolean print(PrinterJob printerJob, PrintRequestAttributeSet attributes) throws PrinterException
printerJob - the printer job.attributes - application supplied attributesPrinterException - if the document cannot be printedpublic Pageable getPageable()
Copyright © 2015–2019 The veraPDF Consortium. All rights reserved.