Skip to content

ap streams to show the new modified values#2

Open
mohamed-mostafa-18 wants to merge 2 commits into
mainfrom
mostafamohamed/integ-366-enhance-pdf-filler-wrapper
Open

ap streams to show the new modified values#2
mohamed-mostafa-18 wants to merge 2 commits into
mainfrom
mostafamohamed/integ-366-enhance-pdf-filler-wrapper

Conversation

@mohamed-mostafa-18
Copy link
Copy Markdown

@mohamed-mostafa-18 mohamed-mostafa-18 commented Mar 23, 2026

Summary

  • Generate explicit /AP (appearance stream) for each filled text and choice field so all PDF renderers display values — not just full viewers like Mac Preview
  • Fill both AcroForm field objects and page annotation widgets, since some PDFs store these as separate objects with the same field names
  • Add inline Type1 font fallback for templates missing AcroForm default font resources (/DR)
  • Remove NeedAppearances flag after filling since we now provide proper appearance streams
  • Skip /AP generation for button fields (checkboxes/radio buttons) which already have pre-built appearances

Context

Filled PDFs showed values in Mac Preview but appeared empty in Slack, Chrome, Google Drive, and Adobe Web. The binary was setting /V values and relying on NeedAppearances = true to tell viewers to render them, but lightweight renderers ignore that flag.

Test plan

  • All existing unit and integration tests pass
  • New unit tests for appearance stream generation, font parsing, PDF escaping, and NeedAppearances removal
  • New integration test verifying /AP streams exist on filled fields
  • Verified filled NM template shows values in Mac Preview

@mohamed-mostafa-18 mohamed-mostafa-18 marked this pull request as ready for review March 23, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant