Draft
Conversation
Agent-Logs-Url: https://github.com/AndreRenaud/PDFGen/sessions/14a57719-0d42-41fb-ac32-aec780f7dd08 Co-authored-by: AndreRenaud <2322636+AndreRenaud@users.noreply.github.com>
…uttons Agent-Logs-Url: https://github.com/AndreRenaud/PDFGen/sessions/14a57719-0d42-41fb-ac32-aec780f7dd08 Co-authored-by: AndreRenaud <2322636+AndreRenaud@users.noreply.github.com>
…le-selection validation Agent-Logs-Url: https://github.com/AndreRenaud/PDFGen/sessions/14a57719-0d42-41fb-ac32-aec780f7dd08 Co-authored-by: AndreRenaud <2322636+AndreRenaud@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
AndreRenaud
April 16, 2026 10:35
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds interactive PDF forms (AcroForms) support to pdfgen, providing three new public API functions and all the infrastructure needed to produce valid, fillable PDF form fields.
New Public API
A new enum (
PDF_FIELD_TYPE_TEXT,PDF_FIELD_TYPE_CHECKBOX,PDF_FIELD_TYPE_RADIO,PDF_FIELD_TYPE_RADIO_BUTTON) is exposed inpdfgen.h.Changes
pdfgen.cOBJ_form_field— new object type added to the object enum.form_fieldunion member — stores field type, page, geometry, name/value strings, font properties, checked state, parent/kids pointers (for radio groups), and on/off appearance XObject references.pdf_object.form_font— newpdf_docfield caching the Helvetica font used for AcroForm/DRand text-field/DAstrings.pdf_object_destroy— clears thekidsflexarray for radio groups.pdf_save_object— newOBJ_form_fieldcase emitting correct PDF widget annotation dictionaries for all four subtypes (text, checkbox, radio group, radio kid).OBJ_catalog— modified to emit an/AcroFormdictionary (with/Fields,/DR,/DA) when any form fields are present.pdf_create_form_xobject— helper creating Form XObject appearance streams without adding them to any page's content stream list.pdf_get_form_font— helper finding or creating a Helvetica Type1 font for use in form field rendering.tests/main.cAdded a new page 6 ("Form Page") demonstrating:
tests/tests.shUpdated expected page count from 5 to 6.