java.awt.print.Printablepublic final class PDFPrintable
extends java.lang.Object
implements java.awt.print.Printable
| Constructor | Description |
|---|---|
PDFPrintable(PDDocument document) |
Creates a new PDFPrintable.
|
PDFPrintable(PDDocument document,
Scaling scaling) |
Creates a new PDFPrintable with the given page scaling.
|
PDFPrintable(PDDocument document,
Scaling scaling,
boolean showPageBorder) |
Creates a new PDFPrintable with the given page scaling and with optional page borders shown.
|
PDFPrintable(PDDocument document,
Scaling scaling,
boolean showPageBorder,
float dpi) |
Creates a new PDFPrintable with the given page scaling and with optional page borders shown.
|
PDFPrintable(PDDocument document,
Scaling scaling,
boolean showPageBorder,
float dpi,
boolean center) |
Creates a new PDFPrintable with the given page scaling and with optional page borders shown.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
isSubsamplingAllowed() |
Value indicating if the renderer is allowed to subsample images before drawing, according to
image dimensions and requested scale.
|
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex) |
|
void |
setSubsamplingAllowed(boolean subsamplingAllowed) |
Sets a value instructing the renderer whether it is allowed to subsample images before
drawing.
|
public PDFPrintable(PDDocument document)
document - the document to printpublic PDFPrintable(PDDocument document, Scaling scaling)
document - the document to printscaling - page scaling policypublic PDFPrintable(PDDocument document, Scaling scaling, boolean showPageBorder)
document - the document to printscaling - page scaling policyshowPageBorder - true if page borders are to be printedpublic PDFPrintable(PDDocument document, Scaling scaling, boolean showPageBorder, float dpi)
document - the document to printscaling - page scaling policyshowPageBorder - true if page borders are to be printeddpi - if non-zero then the image will be rasterized at the given DPIpublic PDFPrintable(PDDocument document, Scaling scaling, boolean showPageBorder, float dpi, boolean center)
document - the document to printscaling - page scaling policyshowPageBorder - true if page borders are to be printeddpi - if non-zero then the image will be rasterized at the given DPIcenter - true if the content is to be centered on the page (otherwise top-left).public boolean isSubsamplingAllowed()
public void setSubsamplingAllowed(boolean subsamplingAllowed)
subsamplingAllowed - The new value indicating if subsampling is allowed.public int print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
throws java.awt.print.PrinterException
print in interface java.awt.print.Printablejava.awt.print.PrinterExceptionCopyright © 2002–2018. All rights reserved.