GetLastStructuredTextDiagnostics

Text, extraction, structured data

Description

Returns JSON describing the most recent structured extraction analysis on this instance

Syntax

Delphi

Function TPDFlib.GetLastStructuredTextDiagnostics: WideString;

DLL

Function DLGetLastStructuredTextDiagnostics(InstanceID: Integer): PWideChar; Stdcall;
Function DLGetLastStructuredTextDiagnosticsA(InstanceID: Integer): PAnsiChar; Stdcall;

ActiveX

Function PDFlib::GetLastStructuredTextDiagnostics() As String

Report

{
  "status": "completed",
  "pages": [
    {
      "page": 1,
      "readingSource": "tagged",
      "warnings": ""
    },
    {
      "page": 2,
      "readingSource": "mixed",
      "warnings": "shared-tagged-form-occurrence-order-unresolved\r\n"
    }
  ]
}

The initial report is {"status":"notRun"}; an extraction attempt starts with {"status":"error","code":"extraction_failed"} and successful analysis replaces it with a completed report

Each completed page records its one-based page, readingSource, and warnings; warnings are a newline-separated string of diagnostic codes, while schema 2 structured JSON uses a warnings array

Reading sources are tagged, mixed, geometric, and geometric-columns

Remarks

The report covers structured JSON, XHTML, CSV, Markdown, and DOCX extraction; invalid requests rejected before extraction can leave the previous report unchanged

A completed report means analysis returned successfully; it does not certify complete semantics, correct layout inference, valid tagging, or PDF/UA conformance

Warnings disclose unsupported object-reference text, unresolved roles or namespaces, cycles or traversal limits, missing source mappings, and ambiguous shared Form XObject occurrences

When structure traversal or binding is incomplete, extracted source text is retained through mixed or geometric fallback; inspect ExtractStructuredPage for per-block provenance and structureComplete

Cancellation or extraction failure can leave the error report; consult LastErrorCode and the normal operation lifecycle for the call result

The getter does not clear the latest error; the DLL A variant returns UTF-8 and DLL string pointers remain valid until the next string-returning call on this instance

See also

SetStructuredTextOptions, GetStructuredTextOptions, ExtractStructuredDocument, ExportDocumentMarkdown, SaveDOCXToStream