Native Linux C ABI form interchange

Use the existing versioned hpdf_document_execute_json_v1 entry point and hpdf_operation_v1 record to export or import scalar and bounded rich AcroForm values as FDF or XFDF

The ABI version, exported symbols, and callback record layout remain unchanged

OperationInputIOOutputIOResultIO
forms.exportOptional PDF input; otherwise use the loaded documentActual FDF or XFDF bytesJSON format, media type, field count, and output byte count
forms.importRequired FDF or XFDF bytes; the destination PDF must already be loadedPrepared updated PDF bytesJSON format, media type, field count, and changed field count

Both operations require format to be exactly fdf or xfdf, with schemaVersion set to 1

{"schemaVersion":1,"type":"forms.export","format":"xfdf"}
{"schemaVersion":1,"type":"forms.import","format":"fdf","fontFamily":"DejaVu Sans","fontSize":12}

Supported values include nested Unicode text fields, checkbox and radio export states, scalar choices, and multiple choices; UTF-8 and BOM-marked UTF-16 XFDF are accepted

FDF RV and XFDF value-richtext use the inline-xhtml-v1 rich profile, with actual regular, bold, italic and bold-italic font programs selected by fontFamily

Signature and pushbutton fields are represented by their names without imported values, preserving populated signatures and existing button behavior

Import regenerates genuine appearances and preserves authenticated AES R5/R6 encryption, read-only fields, DocMDP permissions, and FieldMDP locks

Optional signaturePolicy accepts requireCAdES, requireTimestamp, requireTimestampRevocation, existing trust file or PEM settings, and revocationInfo using the signing-options schema

Explicit signed revocation policy verifies the actual embedded signature attributes, including those in an RFC 3161 document timestamp; externally supplied status bytes cannot replace a missing required attribute

Optional formDataLimits contains positive integer maxBytes, maxFields, maxObjects, maxDepth, maxValues, maxValueCodeUnits, and maxTotalCodeUnits settings, bounded by the native defaults and operation capacity

Existing limits.memoryBytes, outputBytes, and resultBytes additionally constrain preparation and publication; an exhausted interchange limit returns HPDF_STATUS_BUDGET_EXCEEDED

Callbacks execute synchronously on the calling thread and may return partial reads or writes; cancellation is observed while reading form input, parsing, preparing appearances, and publishing the result

The loaded destination handle commits only after the updated PDF and JSON result callbacks succeed; callback errors or cancellation preserve its previous state, while bytes already accepted by a caller-owned sink remain the caller's responsibility

Annotation XFDF operations use a separate append profile with popup/reply references and embedded file or sound streams

Arbitrary CSS layout, embedded FDF files, arbitrary actions and incremental FDF revision interchange remain outside the form-data profile

Native Linux C ABI · Signing and trust options · Native import transaction