SetStructuredTextOptions

Text, extraction, structured data

Description

Sets the instance-wide analysis options for structured JSON, XHTML, CSV, Markdown, and DOCX extraction

Syntax

Delphi

Function TPDFlib.SetStructuredTextOptions(Options: Integer): Integer;

DLL

Function DLSetStructuredTextOptions(InstanceID: Integer; Options: Integer): Integer; Stdcall;

ActiveX

Function PDFlib::SetStructuredTextOptions(Options As Long) As Long

Parameters

Options combines the following flags; PDF_STRUCTURED_ADVANCED_DEFAULT is 11 and enables columns, furniture detection, and table continuation

ConstantValueBehavior
PDF_STRUCTURED_DETECT_COLUMNS1Find consistent geometric column gaps when tagged order is unavailable
PDF_STRUCTURED_DETECT_FURNITURE2Identify repeated text near page margins across selected pages, including page numbers
PDF_STRUCTURED_EXCLUDE_FURNITURE4Omit identified headers, footers, page numbers, and explicit artifacts from serialized blocks
PDF_STRUCTURED_JOIN_TABLES8Coordinate consecutive page fragments of the same tagged table, or geometrically compatible tables near facing page edges
PDF_STRUCTURED_INFER_MERGES16Infer horizontal merged cells in geometric tables; inferred merges retain geometry provenance and confidence

Return values

Returns 1 on success or 0 for an invalid mask; negative values and unknown bits are rejected with LastErrorCode 111, and the previous setting is retained

Remarks

The setting persists on this instance across documents and applies to subsequent extractions; it is separate from each export function's format-specific Options argument

Zero disables these optional analysis steps while retaining real tag-tree order, resolved roles, marked-content bindings, ActualText, and tagged table cells

Furniture detection preserves text by default; removal requires the explicit exclusion flag, and repeated margin detection requires multiple selected pages

Tagged reading order follows the complete mixed /K sequence, including child elements and content references; geometric columns are a fallback and are labeled separately

Column detection supports up to eight geometric columns and is heuristic; repeated margin classification, geometric table continuation, and inferred merges can be inaccurate for unusual layouts

Tagged cell spans come from structure attributes; geometric merge inference is opt-in and does not establish semantic correctness

Table continuation requires fragments in forward order on consecutive source pages and compatible column grids; reversed, repeated, or nonconsecutive pages are not forcibly joined

The setter clears the latest error before validating the mask

See also

GetStructuredTextOptions, GetLastStructuredTextDiagnostics, ExtractStructuredDocument, ExportDocumentMarkdown, SaveDOCXToStream