public class PageExtractor
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
protected int |
endPage |
|
protected PDDocument |
sourceDocument |
|
protected int |
startPage |
| Constructor | Description |
|---|---|
PageExtractor(PDDocument sourceDocument) |
Creates a new instance of PageExtractor
|
PageExtractor(PDDocument sourceDocument,
int startPage,
int endPage) |
Creates a new instance of PageExtractor
|
| Modifier and Type | Method | Description |
|---|---|---|
PDDocument |
extract() |
This will take a document and extract the desired pages into a new
document.
|
int |
getEndPage() |
Gets the last page number (inclusive) to be extracted.
|
int |
getStartPage() |
Gets the first page number to be extracted.
|
void |
setEndPage(int endPage) |
Sets the last page number to be extracted.
|
void |
setStartPage(int startPage) |
Sets the first page number to be extracted.
|
protected PDDocument sourceDocument
protected int startPage
protected int endPage
public PageExtractor(PDDocument sourceDocument)
sourceDocument - The document to split.public PageExtractor(PDDocument sourceDocument, int startPage, int endPage)
sourceDocument - The document to split.startPage - The first page you want extracted (inclusive)endPage - The last page you want extracted (inclusive)public PDDocument extract() throws java.io.IOException
java.io.IOException - If there is an IOErrorpublic int getStartPage()
public void setStartPage(int startPage)
startPage - the first page number which should be extractedpublic int getEndPage()
public void setEndPage(int endPage)
endPage - the last page number which should be extracted