Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 274

Previous Page 273   Index   Next Page 275

Function Reference
Page 274 of 750
CreateStructureTree
Syntax:
LBOOL pdfCreateStructureTree(
const PPDF* IPDF) // Instance pointer
The function creates a global structure tree that is required to create Tagged PDF files.
Notice:
DynaPDF is able to extend an existing structure tree that was imported from an external PDF
file. However, when editing external PDF files the following rules must be considered:
The structure information of a PDF file will only be imported when the entire PDF file is
imported with ImportPDFFile(). When importing single pages with ImportPage() or
ImportPageEx() of a PDF file that contains structure information then tagging will be
disabled because DynaPDF is not able to import the structure information of a PDF file
on a per page basis.
Import first the PDF file and call then CreateStructureTree(). The reverse order causes
that the structure tree will not be imported and tagging will be disabled!
Only one PDF file with structure information can be imported without invalidating the
structure information.
Keep in mind that the structure tree of a PDF file is a complex global structure that is
difficult to edit. Because of this, probably millions of PDF files exist that contain damages
in the structure tree, mostly due to editing actions in certain viewer applications. When
opening an existing page with EditPage() the function tries to find the corresonding
StructParents array of the page in the ParentTree of the document's Structure Tree. When
this action fails then tagging will be disabled for this page. OpenTag() and CloseTag() do
not produce further warnings in this case. The function GetIsTaggingEnabled() can be
used to determine whether tagging is still enabled after an existing page was opened for
editing.
When creating Tagged PDF files it is important to create the PDF file in the logical reading order.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is zero.
 

Previous topic: CreateStdPattern

Next topic: CreateSubmitAction