Document for the Apache PDFBox library.
PDFView#setDocument(Document)
| Modifier and Type | Field and Description |
|---|---|
| private final PDDocument |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Rectangle2D | |
| private int | calculateTextPositionStartIndex(String searchText, String snippetText, List<TextPosition> textPositions)
Note that the number of textPositions might not be equal to the length of the snippetText. |
| public void | |
| public int | getNumberOfPages()
Implements com. Returns the total number of pages inside the document. |
| public Pageable | getPageable()
Implements com. Returns a set of pages to be printed. |
| public List | getSearchResults(String
the text for which to search searchText)Implements com. Returns the list of search results for the given search text. |
| public boolean | isLandscape(int
the page pageNumber)Implements com. Determines if the given page has a landscape orientation. |
| public BufferedImage | renderPage(int
the page number pageNumber, float the scale scale)Implements com. Renders the page specified by the given number at the given scale. |
| document | back to summary |
|---|---|
| private final PDDocument document | |
| PDFBoxDocument | back to summary |
|---|---|
| public PDFBoxDocument(InputStream pdfInputStream) | |
| PDFBoxDocument | back to summary |
|---|---|
| public PDFBoxDocument(File file) throws IOException | |
| calculateMarkerPosition | back to summary |
|---|---|
| private Rectangle2D calculateMarkerPosition(String searchText, String snippetText, List<TextPosition> textPositions) | |
| calculateTextPositionStartIndex | back to summary |
|---|---|
| private int calculateTextPositionStartIndex(String searchText, String snippetText, List<TextPosition> textPositions) Note that the number of textPositions might not be equal to the length of the snippetText. So we need to account for that. See: org.apache.pdfbox.text.PDFTextStripper.WordWithTextPositions | |
| close | back to summary |
|---|---|
| public void close() Implements com. Doc from com. Closes the document.
| |
| getNumberOfPages | back to summary |
|---|---|
| public int getNumberOfPages() Implements com. Doc from com. Returns the total number of pages inside the document.
| |
| getPageable | back to summary |
|---|---|
| public Pageable getPageable() Implements com. Doc from com. Returns a set of pages to be printed. | |
| getSearchResults | back to summary |
|---|---|
| public List Implements com. Doc from com. Returns the list of search results for the given search text.
| |
| isLandscape | back to summary |
|---|---|
| public boolean isLandscape(int pageNumber) Implements com. Doc from com. Determines if the given page has a landscape orientation.
| |
| renderPage | back to summary |
|---|---|
| public BufferedImage renderPage(int pageNumber, float scale) Implements com. Doc from com. Renders the page specified by the given number at the given scale.
| |