Native Linux Drawing Canvas
HPDFHeadlessCanvas.THotPDF and THPDFPage supply the Unix/FPC drawing facade used by the shared HTML importer; these names belong to this unit and do not replace the Windows HPDFDoc classes
Create the document, set optional PageWidth and PageHeight in points, call AddPage, draw through CurrentPage, and save with SaveToFile or SaveToStream
Text uses Unicode TrueType font programs and actual shaping; GetFontBytes selects a Fontconfig family/style, whilst RegisterFontMemory registers explicit sfnt bytes independently of importer lifetime
Fontconfig matching explicitly requires scalable TrueType outlines, retaining requested weight and slant; this selects a usable installed substitute when a requested family otherwise matches an unsupported CFF font
The page supports lines, filled and stroked rectangles, font/colour/spacing state, Unicode text, images, hyperlinks and ordinary text, checkbox, radio, combo and push-button widgets; radio widgets share a genuine parent field
MaxBytes bounds managed font, content and image allocations, MaxOutputBytes bounds serialisation, and MaxObjects, MaxPages and MaxGlyphs bound graph and text work; these limits are allocation guards rather than process RSS accounting
SaveToFile writes a same-directory private temporary file, synchronises it and renames it after successful bounded serialisation; cancellation or failure preserves an existing destination
SetPDFA4Profile accepts a validated sRGB matrix/TRC profile for fresh flattened authoring, adds actual PDF/A-4 metadata and output intent, and emits PDF 2.0; general conformance validation remains a separate verification step
Native workflows and acceptance
SaveToStream(Stream, AllowEmptyArchivalTemplate=False) normally requires a page; the explicit true option permits an empty intermediate template only after SetPDFA4Profile, for bounded page import construction