PdfDocTemplate class.
More...
#include <pdfix.h>
|
| virtual bool | Update ()=0 |
| | Update the document template after adding pages.
|
| virtual bool | LoadFromStream (PsStream *stream, PsDataFormat format)=0 |
| virtual bool | SaveToStream (PsStream *stream, PsDataFormat format, PdfSaveFlags flags)=0 |
| virtual bool | SetDefaults ()=0 |
| | Resets document template to default values.
|
| virtual float | GetProperty (const wchar_t *name) const =0 |
| | Gets the value of the property by name.
|
| virtual bool | SetProperty (const wchar_t *name, float value)=0 |
| | Supply the name of the property and the value as a float, just as you would in a config file.
|
| virtual int | GetRegex (const wchar_t *name, wchar_t *buffer, int len) const =0 |
| | Gets the pattern of the regex by name.
|
| virtual bool | SetRegex (const wchar_t *name, const wchar_t *pattern)=0 |
| | Supply the name of the regex and the pattern as a wstring, just as you would in a config file.
|
| virtual bool | AddPage (int page_num)=0 |
| virtual PdfPageTemplate * | GetPageTemplate (int page_num)=0 |
| | Get the object reffering the document template related to the page.
|
| virtual int | GetNumNodes (int page_num, const char *path) const =0 |
| | Get the number of bboxes.
|
| virtual bool | GetNodeBBox (int page_num, const char *path, int index, PdfRect *bbox) const =0 |
| | Get node bbox.
|
| virtual int | GetVersionMajor () const =0 |
| | Returns the last major version of the supported SDK.
|
| virtual int | GetVersionMinor () const =0 |
| | Returns the last minor version of the supported SDK.
|
PdfDocTemplate class.
PdfDocTemplate is used to customize a logical content detection algorithm based on document set. After pre-processing reference pages and collecting the information about page content the PdfDocTemplate updates the provide information about position of headers, footers, heading structure. Data from the PdfDocTemplate can be saved to the template configuration file for using with other files with the same document template
- See also
- tag-alternate
◆ AddPage()
| virtual bool PdfDocTemplate::AddPage |
( |
int | page_num | ) |
|
|
pure virtual |
Preprocess the page before the document preflight. Methods parses the page and collects information for document preflight.
- Parameters
-
| page_num | The page number to preprocess. |
- Returns
- true if successfull, false otherwise.
- See also
- PdfDocTemplate::AddPage
◆ GetNodeBBox()
| virtual bool PdfDocTemplate::GetNodeBBox |
( |
int | page_num, |
|
|
const char * | path, |
|
|
int | index, |
|
|
PdfRect * | bbox ) const |
|
pure virtual |
Get node bbox.
- Parameters
-
| box | (Filled by the method) Pointer to a rectangle specifying the node's bbox |
- Returns
- true if the node bounding box was identified
◆ GetNumNodes()
| virtual int PdfDocTemplate::GetNumNodes |
( |
int | page_num, |
|
|
const char * | path ) const |
|
pure virtual |
Get the number of bboxes.
- Returns
- the index of the nodes for specific path
◆ GetPageTemplate()
Get the object reffering the document template related to the page.
- Parameters
-
| page_num | The page number for which the information is to be retrieved. |
- Returns
- The PdfPageTemplate object or null in the case of error.
◆ GetProperty()
| virtual float PdfDocTemplate::GetProperty |
( |
const wchar_t * | name | ) |
const |
|
pure virtual |
◆ GetRegex()
| virtual int PdfDocTemplate::GetRegex |
( |
const wchar_t * | name, |
|
|
wchar_t * | buffer, |
|
|
int | len ) const |
|
pure virtual |
Gets the pattern of the regex by name.
- Parameters
-
| name | Name of the regex. |
| buffer | (filled by method) If the buffer is null function returns required length of string |
| len | Length of a buffer to be filled in. |
- Returns
- Number of characters written into buffer of required length.
- See also
- PdfDocTemplate::SetRegex
◆ GetVersionMajor()
| virtual int PdfDocTemplate::GetVersionMajor |
( |
| ) |
const |
|
pure virtual |
Returns the last major version of the supported SDK.
- Returns
- The major version number.
◆ GetVersionMinor()
| virtual int PdfDocTemplate::GetVersionMinor |
( |
| ) |
const |
|
pure virtual |
Returns the last minor version of the supported SDK.
- Returns
- The minor version number.
◆ LoadFromStream()
Imports a document template configuration from a stream. Only JSON and XML formats are supported.
- Parameters
-
| stream | Source stream of the document template. |
| format | Format of the source stream. Only JSON format is supported. |
- Returns
- true if the document templated was loaded successfuly
◆ SaveToStream()
| virtual bool PdfDocTemplate::SaveToStream |
( |
PsStream * | stream, |
|
|
PsDataFormat | format, |
|
|
PdfSaveFlags | flags ) |
|
pure virtual |
Exports document template configuration into a stream. Only JSON and XML formats are supported. Supported flags are kSaveUncompressed and kSaveIncludeComments
- Parameters
-
| stream | Source stream of the document template. |
| format | Format of the source stream. Only JSON format is supported. |
| flags | A PdfSaveFlags value |
- Returns
- true if the the document template was exported successfuly
◆ SetDefaults()
| virtual bool PdfDocTemplate::SetDefaults |
( |
| ) |
|
|
pure virtual |
Resets document template to default values.
◆ SetProperty()
| virtual bool PdfDocTemplate::SetProperty |
( |
const wchar_t * | name, |
|
|
float | value ) |
|
pure virtual |
Supply the name of the property and the value as a float, just as you would in a config file.
- Parameters
-
| name | Name of the propety. |
| value | New value of the property. |
- Returns
- true if value was set, false otherwise.
- See also
- PdfDocTemplate::GetProperty
◆ SetRegex()
| virtual bool PdfDocTemplate::SetRegex |
( |
const wchar_t * | name, |
|
|
const wchar_t * | pattern ) |
|
pure virtual |
Supply the name of the regex and the pattern as a wstring, just as you would in a config file.
- Parameters
-
| name | Name of the regex. |
| pattern | New pattern of the regex. |
- Returns
- true if pattern was set, false otherwise.
- See also
- PdfDocTemplate::GetRegex
◆ Update()
| virtual bool PdfDocTemplate::Update |
( |
| ) |
|
|
pure virtual |
Update the document template after adding pages.
- Returns
- true if the style was set successfuly
- See also
- PdfDocTemplate::AddPage