public class CDocument
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
long |
elementPtr
Native document pointer/handle.
|
| Constructor and Description |
|---|
CDocument()
Create a document instance.
|
| Modifier and Type | Method and Description |
|---|---|
CPage |
createPage(float width,
float height)
Create a page in this document.
|
CStyle |
createStyle()
Create a style object associated with this document.
|
java.util.ArrayList<CPage> |
getPages()
Get all pages in the document.
|
CElementType |
getType()
Get element type.
|
void |
release()
Release the native document resources held by this object.
|
java.lang.String |
render()
Render the document.
|
void |
saveToFile(java.io.OutputStream outputStream)
Save the rendered result to an output stream.
|
void |
saveToFile(java.lang.String outputPath)
Save the rendered result to a file.
|
void |
setFontProvider(CFontProvider fontProvider)
Set the font provider.
|
public CDocument()
This constructor allocates/creates the underlying native document object.
public void release()
After calling this method, the current instance should not be used anymore.
public CElementType getType()
CElementType.ELEMENT_DOCUMENT.public CPage createPage(float width, float height)
width - Page width (unit is implementation-defined; commonly points).height - Page height (unit is implementation-defined; commonly points).CPage instance.public CStyle createStyle()
CStyle instance.public java.lang.String render()
public java.util.ArrayList<CPage> getPages()
CPage objects.public void saveToFile(java.lang.String outputPath)
outputPath - Output file path.public void saveToFile(java.io.OutputStream outputStream)
outputStream - Target OutputStream.public void setFontProvider(CFontProvider fontProvider)
fontProvider - Font provider.