|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.util.Splitter
public class Splitter
Split a document into several other documents.
Field Summary | |
---|---|
protected PDDocument |
currentDocument
The current PDF document that contains the splitted page. |
protected int |
pageNumber
The current page number that we are processing, zero based. |
protected PDDocument |
pdfDocument
The source PDF document. |
Constructor Summary | |
---|---|
Splitter()
|
Method Summary | |
---|---|
protected void |
createNewDocument()
Create a new document to write the splitted contents to. |
protected void |
createNewDocumentIfNecessary()
Interface method, you can control where a document gets split by implementing this method. |
int |
getSplitAtPage()
This will return how many pages each split document will contain. |
protected boolean |
isNewDocNecessary()
Check if it is necessary to create a new document. |
protected void |
processNextPage(PDPage page)
Interface to start processing a new page. |
protected void |
processPages(java.util.List pages)
Interface method to handle the start of the page processing. |
void |
setSplitAtPage(int split)
This will tell the splitting algorithm where to split the pages. |
java.util.List |
split(PDDocument document)
This will take a document and split into several other documents. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PDDocument pdfDocument
protected PDDocument currentDocument
protected int pageNumber
Constructor Detail |
---|
public Splitter()
Method Detail |
---|
public java.util.List split(PDDocument document) throws java.io.IOException
document
- The document to split.
java.io.IOException
- If there is an IOErrorpublic void setSplitAtPage(int split)
split
- The number of pages each split document should contain.public int getSplitAtPage()
protected void processPages(java.util.List pages) throws java.io.IOException
pages
- The list of pages from the source document.
java.io.IOException
- If an IO error occurs.protected void createNewDocumentIfNecessary() throws java.io.IOException
protected void createNewDocumentIfNecessary()
{
if( isPrime( pageNumber ) )
{
super.createNewDocumentIfNecessary();
}
}
java.io.IOException
- If there is an error creating the new document.protected boolean isNewDocNecessary()
protected void createNewDocument() throws java.io.IOException
java.io.IOException
- If there is an problem creating the new document.protected void processNextPage(PDPage page) throws java.io.IOException
page
- The page that is about to get processed.
java.io.IOException
- If there is an error creating the new document.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |