java.lang.Object | |
↳ | com.pdftron.pdf.TemplateDocument |
The class TemplateDocument. Encapsulates a template document that can merged with data to generate any number of PDFs. TemplateDocument instances are created through the Convert class. See Convert.CreateOfficeTemplate.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | e_failure | ||||||||||
int | e_incomplete | ||||||||||
int | e_success |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TemplateDocument(long impl_ptr) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static TemplateDocument | __Create(long impl) | ||||||||||
long | __GetHandle() | ||||||||||
void |
cancelConversion()
Cancel the current template filling, forcing FillTemplateJson to return.
| ||||||||||
void |
close()
Frees the native memory of the object.
| ||||||||||
void |
destroy()
Frees the native memory of the object.
| ||||||||||
PDFDoc |
fillTemplateJson(String json)
Create a PDF by merging JSON data with this template document.
| ||||||||||
void |
fillTemplateJsonToOffice(String json, String output_path)
Create an office file by merging JSON data with this template document.
| ||||||||||
int |
getConversionStatus()
Get the state of the template filling process.
| ||||||||||
String |
getErrorString()
If the template filling finsihed with some kind of error, this returns the value of the error description; otherwise returns an empty string.
| ||||||||||
int |
getNumWarnings()
Return the number of warning strings generated during the template filling process.
| ||||||||||
String |
getTemplateKeysJson()
Get information about the template keys present in the template document.
| ||||||||||
String |
getWarningString(int index)
Retrieve warning strings that have been collected during the template filling process.
| ||||||||||
boolean |
isCancelled()
Has the template filling been cancelled?.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
Cancel the current template filling, forcing FillTemplateJson to return.
PDFNetException |
---|
Frees the native memory of the object. This can be explicitly called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
PDFNetException |
---|
Frees the native memory of the object. This can be explicitly called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
PDFNetException |
---|
Create a PDF by merging JSON data with this template document.
json | -- A JSON dictionary mapping template keys to their replacement content |
---|
PDFNetException |
---|
Create an office file by merging JSON data with this template document. This function currently only supports DOCX input.
json | -- A JSON dictionary mapping template keys to their replacement content |
---|---|
output_path | -- The path where the output file is written |
PDFNetException |
---|
Get the state of the template filling process.
PDFNetException |
---|
If the template filling finsihed with some kind of error, this returns the value of the error description; otherwise returns an empty string.
PDFNetException |
---|
Return the number of warning strings generated during the template filling process. Warning: experimental interface; this method may be renamed or replaced with equivalent functionality in the future.
PDFNetException |
---|
Get information about the template keys present in the template document. Returns a JSON dictionary following this form: https://www.pdftron.com/api/web/Core.html#.TemplateSchema.
PDFNetException |
---|
Retrieve warning strings that have been collected during the template filling process. Warning: experimental interface; this method may be renamed or replaced with equivalent functionality in the future.
index | -- the index of the string to be retrieved. Must be less than GetNumWarnings() |
---|
PDFNetException |
---|
Has the template filling been cancelled?.
PDFNetException |
---|