DynaPDF Manual - Page 338

Previous Page 337   Index   Next Page 339

Function Reference
Page 338 of 839
EditPage
Syntax:
SI32 pdfEditPage(
const PPDF* IPDF, // Instance pointer
SI32 PageNum)
// Page number
This function prepares a page for editing. If the page does exist (PageNum is greater than the number
of pages in the document), new pages are appended until the number of pages is equal PageNum.
An open page must be closed with EndPage() after the required changes are made.
When opening an existing page for editing DynaPDF does the following:
When the page is opened the first time, DynaPDF parses the content stream to determine the
graphics state at the end of the stream.
When tagging is enabled and if the page contains already tagging information then it tries
also to find the StructParents array of the page in the ParentTree of the global structure tree.
If this action fails then tagging will be disabled for this page. The function
GetIsTaggingEnabled() can be used to determine whether tagging is still enabled.
Errors in the content stream will be repaired if possible.
If the content stream contains non-repairable errors then editing is still possible but the result
is of course undefined. Errors are written to the error log (see GetErrLogMessage()).
When closing the page, the graphics state is stored in a compact format so that it is not
required to parse the page again when it will be edited again.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
EditTemplate
Syntax:
SI32 pdfEditTemplate(
const PPDF* IPDF, // Instance pointer
UI32 Index)
// Array index of the template inside the page
This function prepares a template for editing. The parameter Index is the array index inside the page
that contains the template. To get the number of templates used by a page call the function
GetTemplCount().
The current graphics state is saved entirely before the template will be opened. This graphics state is
restored when the template is closed with EndTemplate(). That means, the current font, line width,
fill color and so on are all restored to its values before entering the template.
EndTemplate() requires an open page that must be opened with EditPage() beforehand. After the
changes are made the template must be closed with EndTemplate().
 

Previous topic: DrawPie

Next topic: EditTemplate2, Ellipse