|
PDF Clown 0.1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfclown.tools.PageManager
public final class PageManager
Tool for page management.
Constructor Summary | |
---|---|
PageManager()
|
|
PageManager(Document document)
|
Method Summary | |
---|---|
void |
add(Collection<Page> pages)
Appends a collection of pages to the end of the document. |
void |
add(Document document)
Appends a document to the end of the document. |
void |
add(int index,
Collection<Page> pages)
Inserts a collection of pages at the specified position in the document. |
void |
add(int index,
Document document)
Inserts a document at the specified position in the document. |
Document |
extract(int startIndex,
int endIndex)
Extracts a page range from the document. |
Document |
getDocument()
Gets the document being managed. |
static long |
getSize(Page page)
Gets the data size of the specified page expressed in bytes. |
static long |
getSize(Page page,
Set<PdfReference> visitedReferences)
Gets the data size of the specified page expressed in bytes. |
void |
move(int startIndex,
int endIndex,
int targetIndex)
Moves a page range to a target position within the document. |
void |
remove(int startIndex,
int endIndex)
Removes a page range from the document. |
void |
setDocument(Document value)
Sets the document to manipulate. |
List<Document> |
split()
Bursts the document into single-page documents. |
List<Document> |
split(int... indexes)
Splits the document into multiple subdocuments delimited by the specified page indexes. |
List<Document> |
split(long maxDataSize)
Splits the document into multiple subdocuments on maximum file size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PageManager()
public PageManager(Document document)
Method Detail |
---|
public static long getSize(Page page)
page
- Page whose data size has to be calculated.public static long getSize(Page page, Set<PdfReference> visitedReferences)
page
- Page whose data size has to be calculated.visitedReferences
- References to data objects excluded from calculation.
This set is useful, for example, to avoid recalculating the data size of shared resources.
During the operation, this set is populated with references to visited data objects.public void add(Document document)
document
- Document to be added.public void add(int index, Document document)
index
- Position at which the document has to be inserted.document
- Document to be inserted.public void add(Collection<Page> pages)
pages
- Pages to be added.public void add(int index, Collection<Page> pages)
index
- Position at which the pages have to be inserted.pages
- Pages to be inserted.public Document extract(int startIndex, int endIndex)
startIndex
- The beginning index, inclusive.endIndex
- The ending index, exclusive.
public void move(int startIndex, int endIndex, int targetIndex)
startIndex
- The beginning index, inclusive.endIndex
- The ending index, exclusive.targetIndex
- The target index.public Document getDocument()
public void remove(int startIndex, int endIndex)
startIndex
- The beginning index, inclusive.endIndex
- The ending index, exclusive.public void setDocument(Document value)
public List<Document> split()
public List<Document> split(int... indexes)
indexes
- Split page indexes.
public List<Document> split(long maxDataSize)
maxDataSize
- Maximum data size (expressed in bytes) of target files.
Note that resulting files may be a little bit larger than this value, as file data include (along with actual page data)
some extra structures such as cross reference tables.
|
PDF Clown 0.1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |