PDFix SDK  6.5.0
PdfDocTemplate Struct Referenceabstract

PdfDocTemplate class. More...

Public Member Functions

virtual bool Update (PdfCancelProc cancel_proc, void *cancel_data)=0
 Update the document template after adding pages. More...
 
virtual bool LoadFromStream (PsStream *stream, PsDataFormat format)=0
 Imports a document template configuration from a stream. Only JSON and XML formats are supported. More...
 
virtual bool SaveToStream (PsStream *stream, PsDataFormat format)=0
 Exports document template configuration into a stream. Only JSON and XML formats are supported. More...
 
virtual bool SetDefaults ()=0
 Resets document template to default values.
 
virtual double GetProperty (const wchar_t *name)=0
 Gets the value of the property by name. More...
 
virtual bool SetProperty (const wchar_t *name, double value)=0
 Supply the name of the property and the value as a double, just as you would in a config file. More...
 
virtual int GetRegex (const wchar_t *name, wchar_t *buffer, int len)=0
 Gets the pattern of the regex by name. More...
 
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. More...
 
virtual bool AddPage (int page_num, PdfCancelProc cancel_proc, void *cancel_data)=0
 
virtual PdfPageTemplateGetPageTemplate (int page_num)=0
 Get the object reffering the document template related to the page. More...
 

Detailed Description

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

Member Function Documentation

◆ AddPage()

virtual bool PdfDocTemplate::AddPage ( int  page_num,
PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Preprocess the page before the document preflight. Methods parses the page and collects information for document preflight.

Parameters
page_numThe page number to preprocess.
Returns
true if successfull, false otherwise.
See also
PdfDocTemplate::AddPage

◆ GetPageTemplate()

virtual PdfPageTemplate* PdfDocTemplate::GetPageTemplate ( int  page_num)
pure virtual

Get the object reffering the document template related to the page.

Parameters
page_numThe page number for which the information is to be retrieved.
Returns
The PdfPageTemplate object or null in the case of error.

◆ GetProperty()

virtual double PdfDocTemplate::GetProperty ( const wchar_t *  name)
pure virtual

Gets the value of the property by name.

Parameters
nameName of the propety.
Returns
Value of the property.
See also
PdfDocTemplate::SetRegex

◆ GetRegex()

virtual int PdfDocTemplate::GetRegex ( const wchar_t *  name,
wchar_t *  buffer,
int  len 
)
pure virtual

Gets the pattern of the regex by name.

Parameters
nameName of the regex.
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.
See also
PdfDocTemplate::SetRegex

◆ LoadFromStream()

virtual bool PdfDocTemplate::LoadFromStream ( PsStream stream,
PsDataFormat  format 
)
pure virtual

Imports a document template configuration from a stream. Only JSON and XML formats are supported.

Parameters
streamSource stream of the document template.
formatFormat 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 
)
pure virtual

Exports document template configuration into a stream. Only JSON and XML formats are supported.

Parameters
streamSource stream of the document template.
formatFormat of the source stream. Only JSON format is supported.
Returns
true if the the document template was exported successfuly

◆ SetProperty()

virtual bool PdfDocTemplate::SetProperty ( const wchar_t *  name,
double  value 
)
pure virtual

Supply the name of the property and the value as a double, just as you would in a config file.

Parameters
nameName of the propety.
valueNew 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
nameName of the regex.
patternNew pattern of the regex.
Returns
true if pattern was set, false otherwise.
See also
PdfDocTemplate::GetRegex

◆ Update()

virtual bool PdfDocTemplate::Update ( PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Update the document template after adding pages.

Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if the style was set successfuly
See also
PdfDocTemplate::AddPage