DynaPDF Manual - Page 568
Previous Page 567 Index Next Page 569
Page 568 of 821
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
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 parameters Lang, AltText, and Expansion are all optional. The Lang parameter, if set, must be a
valid language identifier as defined in RFC 3066, Tags for the Identification of Languages. It overrides
the global language identifer that can be set with SetLanguage(). The main language of the
document should always be set with SetLanguage() when creating Tagged PDF files.
Note that several structure elements like btListElem or btTableHeader cannot be used stand alone.
That means the corresponding parent tag must be opened before such a tag can be used. For
example, the tag btListElem is only valid as child of a btList element and btListElemText is in turn
only valid when used as a child of a btListElem tag!
Previous topic: OpenTag
Next topic: Optimize