Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adobe FDF Compatibility #16

Merged
merged 1 commit into from
Aug 9, 2016

Conversation

6C1
Copy link
Contributor

@6C1 6C1 commented Aug 9, 2016

Bug

The FDF files produced by fdfgen.forge_fdf are unable to be imported via Adobe Acrobat's FDF import functionality. They are compatible with PDFtk, which indicates the incompatibility lies in a discrepancy between the Adobe and PDFtk parsers. I assume that the Adobe parser is more strict than the PDFtk parser.

Causes

The causes were identified by producing identical FDF files via both fdfgen and Adobe Acrobat's Export data function, and comparing the results in hexl-mode. They were:

  • Extraneous whitespace. Extra whitespace and newline characters were causing parse failure.
  • Mismatched encoding. Field keys were being encoded in UTF-16 instead of UTF-8.

Fix

Whitespace characters have been removed, and the encoding of field keys has been changed to UTF-8.

Additionally, this PR explicitly spells carriage returns and newlines in hex, as cautioned by Sid Steward in the original forge_fdf.php documentation.

Testing

This fix has been tested by producing FDF files, comparing them at the hex level with Acrobat-produced FDF files, and successfully filling PDF forms with them. The filling was tested with both Adobe Acrobat and PDFtk. Test FDF files included text fields, checkboxes, and radio button groups.

Mostly removing whitespace characters.
@6C1
Copy link
Contributor Author

6C1 commented Aug 9, 2016

This may resolve some of the issues reported in #9.

@thraxil
Copy link
Contributor

thraxil commented Aug 9, 2016

Awesome. Thanks!

@thraxil thraxil merged commit 370b925 into ccnmtl:master Aug 9, 2016
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.

2 participants