Repository navigation
Add a form whose fields each show one entry of variable text appearances - #48
Merged
Merged
Conversation
MartinThoma
force-pushed
the
text-field-appearances
branch
from
December 2, 2026 07:06
ec158c4 to
5d7aedb
Compare
035-text-field-appearances/text-field-appearances.pdf is a form of three pages with 21 text and choice fields and no appearance streams. Each field shows one entry that decides how its appearance looks, and a label next to it names that entry (ISO 32000-2:2020, 12.7.4.3): * the flags Comb (with /MaxLen), Multiline and Combo, and the alignment /Q; * the default appearance /DA: a red font, a /DA without a Tf operator, a field without /DA that uses the /DA of the interactive form, and fields without /DA and without a value; * the border style /BS (with /W 3 and /S /B, and empty) and the border and background colors of /MK; * list boxes with one selected option, and with two (with the flag MultiSelect), without a value and without /Opt, and a combo box; * an old, compressed appearance stream with another /BBox and an /OC entry, which a generated appearance replaces; * fields with /MK /R 90 and 270 on pages with the same /Rotate, laid out as viewers write them, so that the text reads upright. All fields are 200 by 30 points as seen by the reader, and every field is its own widget annotation. /NeedAppearances is true, so that viewers generate the appearances. The file is PDF 1.7, because PDF 2.0 requires an appearance stream for every widget annotation and deprecates /NeedAppearances. create_text_field_appearances_pdf.py writes the file without any PDF library and gives the same bytes on every run. The README of the sample has a Validation section with what qpdf, the veraPDF Arlington checker, Firefox, MuPDF, Poppler and Ghostscript report or show for the file. The README of the repository now asks for such a section for every PDF that is not written by a typical generator such as pdfTeX or a word processor. pypdf uses the file to test the appearance streams it generates for these fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MartinThoma
force-pushed
the
text-field-appearances
branch
from
December 2, 2026 07:53
5d7aedb to
7a1e1bc
Compare
MartinThoma
marked this pull request as ready for review
December 2, 2026 07:53
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.
034-text-field-appearances/text-field-appearances.pdf is a form of three pages with 21 text and choice fields and no appearance streams. Each field shows one entry that decides how its appearance looks, and a label next to it names that entry (ISO 32000-2:2020, 12.7.4.3):
All fields are 200 by 30 points as seen by the reader, and every field is its own widget annotation. /NeedAppearances is true, so that viewers generate the appearances. create_text_field_appearances_pdf.py writes the file without any PDF library and gives the same bytes on every run.
pypdf uses the file to test the appearance streams it generates for these fields.