Closed abevoelker closed 3 years ago
+1
Since this isn't currently part of the ISO standard there are no plans to implement it. Until it is in the ISO standard, it would probably be best if the support was added in some kind of "extension" to pdf.js in a separate repo.
If someone is serious and wants put the work into adding it into mainstream pdf.js they should ping me and I could look into the implications.
I would be interested in working on an extension to support this. It seems pdf2json already has written an extension for pdf.js. Any comments on this?
This should be revisited. Even if XFA is not a de-jure standard, it unfortunately is a de-facto standard (along AcroForms) with great distribution and (medium) renderer support. Since browsers are deprecating NPAPI plugins, it will (for a lot of existing content and content still generated today) no longer be possible to fill out PDFs with forms within the browser, leading to users being annoyed and/or websites force-downloading PDF files to be opened with another PDF reader. Supporting forms in PDF (both XFA and AcroForms) is a unique feature that has the potential to influence the market. Issue #1459 contains further reasoning.
any update?
Currently we're working on AcroForm support (in #7613). XFA support is not planned, but I think the AcroForms work should definitely help to simplify the implementation for XFA support.
Any updates on supporting LiveCycle PDF Documents?
In case this might somehow be useful, perhaps you could use PDFium's XFA implementation code as inspiration for an implementation in pdfjs? I have no idea if it actually works, in any case it's probably better than nothing: https://github.com/chromium/pdfium/tree/master/xfa
I hate to keep asking about this but has there been any progress on this???
XFA support is being developed and experimental, but is progressing.
Thanks so much @timvandermeij is there a timeframe or a pull request that interested parties can follow?
The list of merged PRs is https://github.com/mozilla/pdf.js/pulls?q=is%3Apr+xfa+is%3Aclosed.
I think we can now close this, as the main XFA-related work has landed.
Thanks for all the hard work that went into this!
In what version of Firefox is this expected to land?
Firefox 91
You can already test it in Firefox Nightly, by setting the pdfjs.enableXfa
preference to true.
Got it working. Thanks!
Is is possible now to save the filled input in separate XFA-file or is it merged into the PDF? Or is it not saved at all like in Acrobat Reader?
@keyhan the filled data should be saved as part of the PDF.
XFA forms are XML-based forms created by Adobe's LiveCycle Designer tool. They offer enhanced features over the old AcroForms method of creating fillable PDF forms with things like growable text fields (which can overflow across page boundaries) and "Rich Text," which is a subset of XHTML and CSS for stylizing text. There is also support for running JavaScript and FormCalc (a proprietary scripting language) scripts for manipulating data using a "Scripting Object Model" (SOM - looks sort of like XPath). Other features include network interaction with servers (e.g. form submission) using HTTP or WSDL/SOAP. I believe you can also embed regular PDF documents inside XFA.
I don't pretend to understand XFA (the standard is here), but I have had to deal with it recently as it seems to be the direction that Adobe is pushing towards as until very recently (with the latest version of iText), the only reliable way of manipulating these forms were with Adobe's LiveCycle Server product (epic $). And so far, the only renderer that I've used that can even display them is Adobe Acrobat.
I see XFA has been mentioned on the Mozilla wiki and on the mailing list and it looks like there is some trepidation in supporting it as it is still a proprietary standard. If this is still the case, does that mean that pull requests would also not be accepted relating to XFA?
I can totally understand why you would not want to support a proprietary and complicated standard, but thought I would bring it up anyway as it's frustrating being locked into Adobe Reader and LiveCycle Server products. Thanks!