Native annotation fallback

HPDFRenderHeadlessPagePNG constructs temporary appearances for supported annotations without a normal appearance

Existing normal appearances take precedence; active malformed appearances still fail explicitly

The source document remains unchanged: generated streams and fonts belong to the render operation and are released after use

Geometry and static content

Fallback covers Link borders, Square, Circle, Line, Polygon, PolyLine, Ink, Highlight, Underline, StrikeOut, Squiggly, FreeText, Text, Caret, Stamp, FileAttachment, Sound and Redact preview outlines

Line geometry includes ten line-ending styles and leader lines; supported borders include solid, dashed and underline styles, plus shaded beveled and inset rectangular borders, with explicit empty colour arrays preserving transparency

Popup, Projection and Screen have no standalone painted content without a normal appearance; activated 3D environments, audio, attachments and link actions are outside static raster rendering

Visibility and optional-content checks happen before fallback construction; temporary appearances retain page clipping and the existing view/print, NoZoom and NoRotate geometry rules

Line captions and relief borders

Line captions consume Cap, CP, CO, Contents, RC and DS through the same temporary Unicode text Form path, with measured Inline gaps, Top placement and endpoint-relative offsets

Long captions use above-line placement; explicit paragraph breaks are preserved, and empty plain or rich text leaves the ordinary line intact

Caption bounds retain both the temporary Form BBox and annotation rectangle; ordinary page-content clipping is unchanged

Rectangular beveled and inset borders use opposing light and dark bands with independent border and interior opacity; zero width and empty colour arrays retain their transparency semantics

Unknown named border styles use the solid default, whilst non-name styles remain malformed input

See annotation decorations for the colour policy, font lifetime and independent acceptance coverage

FreeText

Plain text supports PDFDocEncoding, UTF-16 and BOM-prefixed UTF-8; XHTML rich text supports inherited default styling and text-stream RC entries

The bounded FreeText default-appearance profile supports Tf, g, rg, k, Tc, Tw, Tz, Ts, TL, one Tm, Tr and stroke state G, RG, K, w, J, j, M and d; zero Tf font size requests transformed automatic fitting

Embedded default TrueType fonts use document font bytes; original Type1C, CIDFontType0C and bare Type1 resources, complete OpenType CFF input and OpenType CFF2 default instances use their documented original-font paths; supported standard fonts and rich-text families use the local platform resolver

Temporary text appearances use the explicit read-only family builder, including Preview/Print-only TrueType outline fonts; full font bytes and permission flags are preserved, whilst existing editing builders retain their original admission

DA font names resolve through Catalog AcroForm.DR.Font before page resources; page resources and recognised standard aliases are recovery paths when the default binding is absent

Text layout supports alignment, quarter-turn rotation, rectangle differences and callout geometry; generated font resources remain isolated from existing resources and encrypted source streams

Bounds and unfinished handlers

Operation, token, decoded-byte, working-memory and output limits apply to generated geometry, text and fonts; cancellation and failed rendering preserve the same source and publication contracts as existing appearances

Screen without an appearance has no default static image or border; a supplied normal appearance retains priority in both view and print usage

Missing appearances are optional in PDF 1.2–1.7; PDF 2.0 requires appearances except for its specified exceptions, so missing-appearance Path fixtures verify recovery rather than conforming PDF 2.0 writing

Standalone raw CFF2 streams, nondefault variation coordinates, operators outside the documented DA profile and further fallback handlers remain outside this implementation; arbitrary transformed raster envelopes are not established by finite acceptance controls

Tr4 through Tr7 use accumulated glyph-outline clips; their four finite two-run controls passed native comparisons and independent MuPDF 1.28.5 and Poppler reader checks, as recorded in the DA topic

Redact fallback displays a preview outline and does not remove or redact page content

Static icon styles and text layout can differ between processors; independent formulas and separate MuPDF/Poppler observations are retained in Tests/Linux/HeadlessAnnotationFallback.en-us.md

See native Cairo rendering and ISO 32000-2 annotation errata for renderer and format context

See native cloudy annotation borders for continuous contour construction, Unicode content bounds and the normal acceptance entry points