Native Linux HTML, Editing, OCR and Archival Workflows

The native Linux callback ABI accepts html.import, text.draw, ocr, and pdfa.convert with schemaVersion 1 and the existing output, result, working-byte and pixel budgets

HTML import

{"schemaVersion":1,"type":"html.import","html":"<h1>Invoice</h1><p>Searchable Unicode</p>","createAcroForms":true}

HTML import works on an empty handle and uses the shared HTML5/CSS layout engine with a native drawing canvas, Fontconfig matching, embedded Unicode TrueType fonts, HarfBuzz/FriBidi shaping, PNG/JPEG/BMP/GIF resources, alpha masks, hyperlinks, pagination and AcroForm controls

The ABI accepts inline data resources; it does not install a network or file resource callback, while Pascal callers can supply the existing importer callback for explicit font, image and stylesheet resources

Optional pageWidth and pageHeight use points; maxPages and maxLayoutOperations must be positive, and DOM, CSS, resource and image allocations also follow the operation budget

Page text editing

{"schemaVersion":1,"type":"text.draw","page":0,"text":"Searchable Unicode","left":36,"bottom":36,"right":559,"top":108,"fontFamily":"DejaVu Sans","fontSize":12,"invisible":true}

Insertion preserves original page streams, including indirectly referenced content arrays, and appends an embedded Unicode form appearance with a private resource name; invisible text uses rendering mode 3 and remains searchable

Coordinates are unrotated PDF user-space points; characterSpacing and wordSpacing use points, and authenticated AES-256 replacements retain encryption, passwords and permissions

The Pascal AppendPageText API additionally accepts quarter-turn appearance rotation and explicit rectangle fitting

Actual OCR

{"schemaVersion":1,"type":"ocr","pages":[0],"language":"eng","dpi":216,"searchLayer":true,"maxMilliseconds":120000}

OCR renders actual page pixels and invokes the installed Tesseract executable directly with an argument vector, reads bounded TSV words, validates UTF-8, confidences and page coordinates, and maps rotated/cropped page geometry back to PDF coordinates

The result includes per-page words with text, confidence, left, bottom, right and top; searchLayer false returns recognition data, while true also emits a PDF with fitted invisible embedded-font text

Optional tesseractPath selects an explicit executable; maxWords, minimumConfidence and maxMilliseconds bound recognition, and cancellation or timeout terminates and reaps the running process

Native PDF/A-4 raster output

{"schemaVersion":1,"type":"pdfa.convert","profile":"PDF/A-4","dpi":144}

Native raster conversion authors fresh unencrypted PDF 2.0 pages with baked page rotation, PDF/A-4 XMP, document identifiers and a generated embedded sRGB output intent; current acceptance includes independent veraPDF validation with zero failed rules and checks

The output rasterizes original text and vectors, flattens visible appearances, replaces source metadata and drops interactive fields, actions, attachments and signatures; the result reports rasterized, removedFormFields and removedSignatures

Signed inputs require explicit allowSignatureInvalidation true; visible annotations need usable normal appearances before flattening, and native text/vector preservation provides a searchable conversion mode with genuine validation

Explicit archival font repair embeds available substitutes through bounded Ghostscript normalization, retains searchable text and vectors, and validates PDF/A-4 before publication

Publication and runtimes

All binary output is prepared before callbacks; a generated or edited document replaces the handle only after output and JSON callbacks succeed, and failures preserve the previous context

Native HTML requires FCL image readers, Fontconfig, installed Unicode TrueType fonts, HarfBuzz and FriBidi; OCR additionally requires Tesseract and trained language data, and archival profile generation requires Little CMS 2

Callback ABI · Native drawing canvas · Pascal OCR API · Pascal archival API

Append selected pages and validate text/vector-preserving PDF/A-4 output