Automatic XFA push button captions and states
HPDFXFAWriteHeadlessPDF creates actual native push button widgets from XFA layout, including effective scalar or XHTML captions, supplied font programs, visibility, readonly flags and interactive highlight metadata
Each widget has FT Btn, the pushbutton Ff flag, an explicit normal appearance and a Unicode MK.CA caption derived from its actual rendered content; a button does not become a text-input field and no placeholder PDF field is required
A visible normal caption also retains a DA entry whose font alias resolves through AcroForm.DR to an actual normal-caption Type0 font; no empty placeholder font is embedded for compatibility
Caption content and layout
Scalar caption font size, weight, posture, typeface and colour, plus XHTML inline styles and mixed baselines, use the existing native rich-text decoder and appearance builder
CaptionFontFamilies supplies real regular, bold, italic and bold-italic programs and named families; faces are never synthesised and font programs are not discovered or downloaded
Whitespace-only text between XHTML inline elements is retained, so adjacent differently styled words preserve their authored separators
Missing caption content retains the existing field-name fallback, whilst explicit empty content stays blank and nonempty scalar captions preserve authored leading and trailing spaces; hidden, inactive and invisible captions paint no text and serialise no regenerable visible caption
Field and caption margins, caption placement, reserve and paragraph alignment determine the actual caption region; missing, zero and schema-default negative-one reserve use natural extent without automatic wrapping, positive reserve allows wrapping and inline placement ignores reserve
Fixed field bounds clip oversized captions; explicit paragraph breaks remain active and effective per-instance overlays retain unchanged template siblings
Highlight and state appearances
| XFA highlight | Native PDF result |
|---|---|
| inverted or absent | H I with normal AP.N; the reader applies the inverted activation treatment |
| none | H N with normal AP.N |
| outline | H O with normal AP.N; the reader applies the frame activation treatment |
| push | H P with actual normal AP.N, down AP.D and rollover AP.R Forms; the down caption is displaced to represent depression |
In push mode, scalar items named down and rollover supply their respective captions and MK.AC or MK.RC metadata; an absent state item uses the normal caption, whilst an explicit empty item gives a blank state
Alternate items do not affect other highlight modes, and each generated state retains its own actual appearance and supplied-font graph
Transactions and limits
Actual repeated-instance event changes can be saved as XDP, reloaded and consumed by the creator; immediate read, overlay and whole-payload replacement, first-instance isolation and failed-event rollback remain native runtime operations
Source nodes and bytes, font programs, glyph units, objects and candidate bytes are bounded; cancellation and preparation failures preserve caller stream bytes, length and position
The final write into the caller's stream is the commit boundary; an exception raised by that stream during writing can leave a partial write and is not presented as a rolled-back nonseekable destination
This consumer creates saved widget appearance states; later reader-driven XFA script execution or appearance rebuilding, rich alternate item content, button icons, external media and arbitrary foreign XML rendering remain separate capabilities
The highlight and caption reserve mappings follow XFA 3.3 button and caption semantics
Emitter metadata · Boolean rich captions · Automatic native XFA creation