public class PageExtractor extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
endPage |
protected PDDocument |
sourceDocument |
protected int |
startPage |
Constructor and 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 and 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 IOException
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 extractedCopyright © 2002–2017 The Apache Software Foundation. All rights reserved.