public static class PrintProcessor.DefaultPageable extends Book
重写PDFPageable
UNKNOWN_NUMBER_OF_PAGES
Constructor and Description |
---|
DefaultPageable(PDDocument document,
org.apache.pdfbox.printing.Orientation orientation,
Printable printable)
Creates a new PDFPageable with the given page orientation and with optional page borders
shown.
|
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfPages() |
PageFormat |
getPageFormat(int pageIndex) |
Printable |
getPrintable(int i)
Returns the
Printable instance responsible for
rendering the page specified by pageIndex . |
protected org.apache.pdfbox.pdmodel.common.PDRectangle |
getRotatedCropBox(org.apache.pdfbox.pdmodel.PDPage page)
This will find the CropBox with rotation applied, for this page by looking up the hierarchy
until it finds them.
|
protected org.apache.pdfbox.pdmodel.common.PDRectangle |
getRotatedMediaBox(org.apache.pdfbox.pdmodel.PDPage page)
This will find the MediaBox with rotation applied, for this page by looking up the hierarchy
until it finds them.
|
public DefaultPageable(PDDocument document, org.apache.pdfbox.printing.Orientation orientation, Printable printable)
document
- the document to printorientation
- page orientation policyprintable
- true if page borders are to be printedpublic int getNumberOfPages()
getNumberOfPages
in interface Pageable
getNumberOfPages
in class Book
public PageFormat getPageFormat(int pageIndex)
Returns the actual physical size of the pages in the PDF file. May not fit the local printer.
getPageFormat
in interface Pageable
getPageFormat
in class Book
public Printable getPrintable(int i)
Printable
instance responsible for
rendering the page specified by pageIndex
.getPrintable
in interface Pageable
getPrintable
in class Book
i
- the zero based index of the page whose
Printable
is being requestedPrintable
that renders the page.protected org.apache.pdfbox.pdmodel.common.PDRectangle getRotatedCropBox(org.apache.pdfbox.pdmodel.PDPage page)
protected org.apache.pdfbox.pdmodel.common.PDRectangle getRotatedMediaBox(org.apache.pdfbox.pdmodel.PDPage page)
Copyright © 2024. All rights reserved.