| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final PDDocument | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | PageExtractor(PDDocument
The document to split. sourceDocument)Creates a new instance of PageExtractor |
| public | PageExtractor(PDDocument
The document to split. sourceDocument, int The first page you want extracted (1-based, inclusive) startPage, int The last page you want extracted (1-based, inclusive) endPage)Creates a new instance of PageExtractor |
| Modifier and Type | Method and Description |
|---|---|
| public PDDocument | Returns: The extracted documentThis will take a document and extract the desired pages into a new document. |
| public int | Returns: the last page number which should be extractedGets the last page number (inclusive) to be extracted. |
| public int | Returns: the first page number which should be extractedGets the first page number to be extracted. |
| public void | setEndPage(int
the last page number which should be extracted endPage)Sets the last page number to be extracted. |
| public void | setStartPage(int
the first page number which should be extracted startPage)Sets the first page number to be extracted. |
| endPage | back to summary |
|---|---|
| private int endPage | |
| sourceDocument | back to summary |
|---|---|
| private final PDDocument sourceDocument | |
| startPage | back to summary |
|---|---|
| private int startPage | |
| PageExtractor | back to summary |
|---|---|
| public PageExtractor(PDDocument sourceDocument) Creates a new instance of PageExtractor
| |
| PageExtractor | back to summary |
|---|---|
| public PageExtractor(PDDocument sourceDocument, int startPage, int endPage) Creates a new instance of PageExtractor
| |
| extract | back to summary |
|---|---|
| public PDDocument extract() throws IOException This will take a document and extract the desired pages into a new document. Both startPage and endPage are included in the extracted document. If the endPage is greater than the number of pages in the source document, it will go to the end of the document. If startPage is less than 1, it'll start with page 1. If startPage is greater than endPage or greater than the number of pages in the source document, a blank document will be returned.
| |
| getEndPage | back to summary |
|---|---|
| public int getEndPage() Gets the last page number (inclusive) to be extracted.
| |
| getStartPage | back to summary |
|---|---|
| public int getStartPage() Gets the first page number to be extracted.
| |
| setEndPage | back to summary |
|---|---|
| public void setEndPage(int endPage) Sets the last page number to be extracted.
| |
| setStartPage | back to summary |
|---|---|
| public void setStartPage(int startPage) Sets the first page number to be extracted.
| |