The latest build of Prince now supports PDF Forms!
You can generate the form from the attached HTML like this:
prince --pdf-forms simple-form.html
This creates a form that can be filled in with Acrobat or other PDF viewers and saved or printed. You may also wish to specify --pdf-profile=PDF/UA-1 for accessibility.
Most HTML form controls are supported and it is also possible to include submit and reset buttons, although not every PDF viewer supports these yet.
The new --pdf-forms option is a shorthand for applying "prince-pdf-form: enable" to all of the form elements; this new CSS property allows individual form elements to be selectively enabled or disabled. We may enable PDF Forms by default in Prince 15.
Please try the latest build and let us know how you go!
So, would you recommend a "latest build" in production? Not being backwards compatible means that a feature introduced in a "latest build" might break/behave differently in a future release, is that right?
We try to avoid this, but new features can shift in response to early feedback, yes. There is a bit of a chicken and egg issue if nobody uses it until it's frozen and we can't freeze it until people use it.
Hi Mike, I don't think there is a clear answer, so I'll attempt to ask this question again. When will this PDF forms feature make its way to the numbered release (official)? I have done some local testing, and it looks like the latest numbered release, 14.3, doesn't have it yet. This is very important to us.
Hi Make, I have downloaded an example from this page, simple-form.pdf, and when I opened it in the Acrobat Reader application, all the input text showed up as squares. However, it seems to work fine when the same pdf is opened in the browser (Chrome in my case). Please see the screenshots below.
I wonder what causes this and how this issue can be solved.
Hi Mike, I did some digging, and it looks like the font reference attached to the form field have the weird prefix PXAAAA+. Please see the attached screenshot for more details. I'm seeing the same thing when I generate my PDF with forms. In my case, it referencing PXAAAA+Helvetica
First off, this is an amazing add and will save us a lot of time.
Quick feature request, could it also read the html "type" attribute and create applicable PDF fields based on that? Such as input type="date" making a "Date" field in the PDF and input type="number" using number formatting by default (Bonus points for reading the min, max and pattern attributes as well for this!). Would also like to replicate the native "Digital Signature" field you can add in Acrobat if possible. Thanks!
I think that's possible but it might need to a wait a while, PDF doesn't seem to have specific field types so dates and numbers are implemented via AcroJS extensions.
Can we set font settings for PDF form fields? Specifically I would like to set the "Auto" font size so text autoscales to fit inside the field in case the content runs long.
@howcome, uh – my fault: We’re still on Prince 14.3. I’ll tell the IT to upgrade ...
@mikeday I have a proposal for your announcements of newly integrated features in this forum: Would you mind writing the PrinceXML version number into your post? So please write better
We have fixed this issue in the latest builds (v15.2) and font subsetting should work correctly with PDF Forms now.
since then I don’t have to check the post’s date and compare it to the release date in the release notes to determine the correct release for the feature, when I search the forum and find an older post with the announcement.
I saw in the changelogs that we have this specific field type: prince-pdf-signature. But I couldn't find any documentation on it.
Or is it as simple as writing this <input type="prince-pdf-signature"> and it's gonna be a field that I can use with other software to sign my PDF with a digital certificate?
Or is it as simple as writing this <input type="prince-pdf-signature"> and it's gonna be a field that I can use with other software to sign my PDF with a digital certificate?
Correct. The reason it still is not in documentation is that it is not yet part of any numbered release.
For anyone in the future trying to access features marked as Done in the Roadmap, probably just try the latest builds: https://www.princexml.com/latest/
We have verified the input type "prince-pdf-signature" for the latest build 20241128. The digital signature fields can be signed with Acrobat Reader, but there are still the following issues:
The Signature Panel of the Reader is always empty, even the menu is missing
Function "Validate all signature" fails with the following error message: