java.lang.Object | |
↳ | com.priint.comet.renderer.util.W2ML |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static int |
calculateSpreadIndex(int pageIndex, boolean facingPages, PageType firstPageType)
Calculates the spread index for a given page index The spread index is calculated based on the following assumptions:
| ||||||||||
final static void |
clearContent(W2MLDocument from)
Removes all content of a W2MLDocument. | ||||||||||
final static W2MLDocument |
documentFromPath(Path path)
Creates a W2MLDocument from file denoted by path @return | ||||||||||
final static W2MLDocument | documentFromStream(InputStream in) | ||||||||||
final static W2MLDocument | documentFromString(String w2mlStr) | ||||||||||
final static String | documentToString(W2MLDocument document) | ||||||||||
final static W2MLDocument | extractSpread(byte[] source, int spreadIndex) | ||||||||||
final static void | removeElement(W2MLDocument from, int elementId) | ||||||||||
final static void | removePage(W2MLDocument from, int pageIndex) | ||||||||||
final static void |
removePages(W2MLDocument from)
Removes all pages and related content from a W2ML document Removes all pages page by page and related content from a W2MLDocument.org.junit.Test The result is an empty document, containing just masterpages, style definitions, swatches etc.org.junit.Test Note: a renderer document requires at least one page. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Calculates the spread index for a given page index
The spread index is calculated based on the following assumptions:
pageIndex | 0-based index of the page |
---|---|
facingPages | whether document has facing pages or not |
firstPageType | type of the first page |
Removes all content of a W2MLDocument.
Removes all content (including pages, but not master pages) from a document by clearing the root nodes of content related elements in the documents DOM.
See removePages(W2MLDocument)
for further documentation, also
Note: the result of this method call is literally the same like
when calling removePages(W2MLDocument)
. clearContent(W2MLDocument)
may be slightly faster, but in terms of observing document integrity less accurate
than removePages(W2MLDocument)
. One or the other may be removed in future
or just delegate to the other, depending on which works better in "real life".
RendererException |
---|
Creates a W2MLDocument from file denoted by path
@returnRendererException |
---|
RendererException |
---|
Removes all pages and related content from a W2ML document
Removes all pages page by page and related content from a W2MLDocument.org.junit.Test The result is an empty document, containing just masterpages, style definitions, swatches etc.org.junit.Test Note: a renderer document requires at least one page. Unlike common rendering applications (such as Adobe InDesign® or Adobe Illustrator®), the pdf renderer does not crash, if a zero-page document is opened, but adds a single default page instead.org.junit.Test Hence, the page count reported by the renderer will always be at least 1 and not 0, what you might expect after removing all pages.
Note: the result of this method call is literally the same like
when calling clearContent(W2MLDocument)
. These methods only differ in
internal functionality. One or the other may be removed in future or just delegate
to the other, depending on which works better in "real life".
from | document to delete from |
---|
RendererException |
---|