GetLastMetafileDiagnostics
Vector graphics, Image handling, Diagnostics
Description
Returns JSON describing the latest metafile import on the selected document, including dedicated EMF imports and metafiles added through generic image imports
Syntax
Delphi
Function TPDFlib.GetLastMetafileDiagnostics: WideString;
ActiveX
Function PDFlib::GetLastMetafileDiagnostics() As String
Available on IPDFlibrary2 from type library version 3.3
DLL
const wchar_t* DLGetLastMetafileDiagnostics(int InstanceID);
const char* DLGetLastMetafileDiagnosticsA(int InstanceID);
Return values
Returns JSON describing the most recent metafile import on the selected document. When no document is open it returns a JSON stub indicating that no metafile import has run.
Report
| schemaVersion | Report format version, currently 1 |
|---|---|
| backend | windows-vector, windows-raster, native-vector, or metafile-loader; empty before the first import |
| status | not-run before import, complete after vector conversion without diagnosed issues, partial after successful conversion with warnings, failed after failure, or rasterized after bitmap import |
| success | Whether conversion completed without a fatal error; inspect warnings even when this value is true |
| recordsInspected, recordCount | Whether vector records were inspected and how many were visited, including the EMF header and end-of-file record when reached |
| issueCount, unsupportedRecordCount, invalidRecordCount, errorCount | Total issues and the unsupported, invalid, and fatal-error counts |
| truncated, issues | At most 512 detailed issues with up to 2048 message characters each; counts continue after the detail limit, and truncated indicates omitted issue entries |
Each issue contains recordIndex, recordType, severity, code, and message. Record indices are one-based; loader failures use zero because no individual record was reached
Remarks
Imports replace the document report, including failed imports and explicit raster imports. An ordinary non-metafile image import does not clear it, and the getter does not start conversion
Raster imports report recordsInspected: false and do not claim vector-record coverage. A complete vector report means no issue was diagnosed by this converter; it is not a certification of pixel equivalence for arbitrary input
Warnings identify unknown records, unconverted device escapes, destination-dependent fills and regions, logical palettes, OpenGL, path widening, unsupported state, EMF+ drawing comments, and specialised colour-managed alpha, masking, parallelogram, or transparent bitmap paths that have not been qualified
Windows vector import retains literal DIB colours, monochrome brush colours, hatch foreground and opaque or transparent backgrounds, and device brush origins across saved contexts. Pattern variants are frozen for their colour state, and retained pattern bitmap data is limited to 64 MiB per conversion
ANSI and Unicode text, multiple-text records, and compact text can supply native glyph outlines inside path brackets, without painting text before the path is filled, stroked, or used as a clip
This getter is available through Delphi, DLGetLastMetafileDiagnostics, DLGetLastMetafileDiagnosticsA and the IPDFlibrary2 Automation extension