pdfCreateStructureTreeEx
Open the document-root structure element with an explicit root
| Category | Tagged PDF / structure tree |
|---|
Purpose — Open the document-root structure element with an explicit root tag.
Description — Fails immediately if a structure tree already exists (StructElemCount > 0) — this can only be called once per instance, as the very first structure operation. On success it also opens the root element onto the open-tag stack (equivalent to an implicit pdfOpenTag(RootTag)), so pdfSetTagID/pdfSetStructElemTitle called immediately after this apply to the root element.
Declarations
BOOL32 __stdcall pdfCreateStructureTreeEx(PPDF IPDF, TPDFBaseTag RootTag);
function pdfCreateStructureTreeEx(const IPDF: PPDF; RootTag: TPDFBaseTag): LongBool; stdcall; external 'LumasPdf.dll';
TPDFBaseTag (from Lumas.Pdf.Types; a subset of the ISO 32000 standard structure types):
TPDFBaseTag = (btArt, btArtifact, btAnnot, btBibEntry, btBlockQuote,
btCaption, btCode, btDiv, btDocument, btFigure, btForm,
btFormula, btH, btH1, btH2, btH3, btH4, btH5, btH6, btIndex,
btLink, btList, btListElem, btListText, btNote, btP, btPart,
btQuote, btReference, btSection, btSpan, btTable,
btTableDataCell, btTableHeader, btTableRow, btTOC, btTOCEntry,
btCL, btLabel, btRuby, btWarichu, btAbbr, btCallout, btDek,
btEm, btLineNum, btReason, btRedaction, btSidebar, btStrong,
btSub, btSup);
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle with an open content stream (the root element also gets an MCID-tagged marked-content region on the current page). |
RootTag | TPDFBaseTag | Structure type for the root element — typically btDocument, but any tag is accepted. |
Return value — TRUE on success; FALSE if a structure tree already exists, there's no open content stream to write the opening BDC operator into, or the handle is invalid.
See also — pdfOpenTag (V12 tagged-PDF chapter), pdfSetTagID
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Object Creation
pdfCreateStructureTreeEx
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.