PdfViewer
Overview
PdfViewer is a class in Aspose.Pdf FOSS for Java.
Inherits from: Printable, AutoCloseable.
Facade for viewing and printing PDF documents.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
autoResize | boolean | Read | Returns whether pages are auto-resized to fit the paper. |
autoRotate | boolean | Read | Returns whether pages are auto-rotated to best fit. |
printPageDialog | boolean | Read | Returns whether a print dialog is shown before printing. |
printAsGrayscale | boolean | Read | Returns whether to print in grayscale. |
resolution | int | Read | Returns the rendering resolution in DPI. |
useIntermidiateImage | boolean | Read | Returns whether intermediate image is used. |
Methods
| Signature | Description |
|---|---|
PdfViewer() | Creates a new PdfViewer instance. |
bindPdf(inputFile: String) | Binds a PDF file to this viewer. |
bindPdf(stream: InputStream) | Binds a PDF from an input stream. |
bindPdf(doc: Document) | Binds an existing Document to this viewer. |
openPdfFile(inputFile: String) | Opens a PDF file (alias for bindPdf). |
printDocumentWithSettings(pageSettings: PrintPageSettings, printerSettings: PdfPrinterSettings) | Prints the document with specified page and printer settings. |
printDocumentWithSettings(printerSettings: PdfPrinterSettings) | Prints the document with the specified printer settings using default page settings. |
printDocument() | Prints the document using default settings. |
printLargePdf(inputFile: String) | Prints a large PDF file (binds and prints). |
decodePage(pageNum: int) → BufferedImage | Renders a single page to a BufferedImage. |
decodeAllPages() → BufferedImage[] | Renders all pages to BufferedImage array. |
print(g: Graphics, pf: PageFormat, pageIndex: int) → int | |
isAutoResize() → boolean | Returns whether pages are auto-resized to fit the paper. |
setAutoResize(v: boolean) | Sets whether pages are auto-resized to fit the paper. |
isAutoRotate() → boolean | Returns whether pages are auto-rotated to best fit. |
setAutoRotate(v: boolean) | Sets whether pages are auto-rotated. |
isPrintPageDialog() → boolean | Returns whether a print dialog is shown before printing. |
setPrintPageDialog(v: boolean) | Sets whether a print dialog is shown. |
isPrintAsGrayscale() → boolean | Returns whether to print in grayscale. |
setPrintAsGrayscale(v: boolean) | Sets whether to print in grayscale. |
getResolution() → int | Returns the rendering resolution in DPI. |
setResolution(v: int) | Sets the rendering resolution in DPI. |
setUseIntermidiateImage(v: boolean) | Sets whether to use an intermediate image for printing. |
isUseIntermidiateImage() → boolean | Returns whether intermediate image is used. |
closePdfFile() | Closes the PDF file (alias for close). |
close() |