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

Enable support for AcroForms in viewer #1459

Closed
jviereck opened this issue Mar 31, 2012 · 25 comments
Closed

Enable support for AcroForms in viewer #1459

jviereck opened this issue Mar 31, 2012 · 25 comments

Comments

@jviereck
Copy link
Contributor

There is some code for AcroForms under examples, but it's not used within the viewer due to a bug in the Firefox printing codebase that is fixed in Firefox Aurora 13. See https://bugzilla.mozilla.org/show_bug.cgi?id=703171#c5.

@notmasteryet
Copy link
Contributor

Related issue #1313

@notmasteryet
Copy link
Contributor

Past issue where forms landed #749

Printing support might not be the only blocker, users might request the "save as ..." functionality? From printing point of view, currently we are keeping only number of pages (20?), there might be a case when we will not be able to print whole document / fields.

@jviereck
Copy link
Contributor Author

jviereck commented Apr 6, 2012

Printing support might not be the only blocker, users might request the "save as ..." functionality? From printing point of view, currently we are keeping only number of pages (20?), there might be a case when we will not be able to print whole document / fields.

Thanks a lot for raising this issues!

For the "Save as" issue: There seems to be no real API to store data on the client. We could implement this functionality by adding some functions to the extension code, but I'm afraid that might be a security issue.

What do you think about proposing a new WebAPI? To store some data on the computer, the page has to require some permission from the user first (like getting the GPS data) and once the user accepts this, can choose a location to store the files.

@jviereck
Copy link
Contributor Author

Printing support might not be the only blocker, users might request the "save as ..." functionality? From printing point of view, currently we are keeping only number of pages (20?), there might be a case when we will not be able to print whole document / fields.

We can print now (at least in Firefox). I think we should enable the form support now for the Firefox Addon at least.

For saving the file:

  • the download attribute has landed in Firefox
  • as we have only to append the existing PDF data, can we create a blob that holds the concatenation of the old PDF data + the new data, create a objectURL and use the URL on the download attribute?
  • you can start downloading a file by calling a.click(), where a is the <a download=...> tag

@silviapfeiffer
Copy link

Is there any way to fill in forms? I can see them, but there are no input elements displayed. Is this bug for working on this feature or is that a new bug? And... is somebody actually working on a form filling viewer interface?

@brendandahl
Copy link
Contributor

Forms were put on hold for now see https://groups.google.com/forum/#!topic/mozilla.dev.pdf-js/XSAD98rYW5I

@1ec5
Copy link

1ec5 commented Feb 28, 2014

Those statistics don’t account for the upcoming tax season. :-)

@SunboX
Copy link
Contributor

SunboX commented Mar 19, 2014

👍 for AcroForm/XFA support

How about embedding the form data in the downloadable pdf?

@mchavarriae
Copy link

That's write, in the tax season this percentage will increase considerably.

Somebody here make an excelente work, maybe somebody can merge his changes to the pdfjs.

http://www.codeproject.com/Articles/466362/Blend-PDF-with-HTML

@edpirone
Copy link

I'm a bit confused by the previous thread comments. This seems like it is still an issue. I just downloaded the most recent stable and cannot fill out fields in a PDF form. Is this still being worked on or has it been tabled?

@timvandermeij
Copy link
Contributor

We have partial AcroForms support, but indeed it's far from complete. We have seen telemetry results and asked users, but there was not much demand for AcroForms support. If someone wants to work on this, feel free to so and submit a pull request for review though!

@edpirone
Copy link

Thanks for the quick response. Ill keep posted.

@wamatt
Copy link

wamatt commented Feb 17, 2015

👍 for AcroForms and or XFA.

Not sure why it's not showing up in telemetry data. Seems like a fairly common use case. Pretty much every federal .gov (and most state gov) pdf I've seen have fillable fields.

@timvandermeij any idea how many dev hours it might take to ship something sort of usable? Like, are the input primitives and datastructs mapped, leaving mostly UI work? Or, is it more complicated than that?

It might make sense for my team to work on it, if there is a quick win.

@wamatt
Copy link

wamatt commented Feb 17, 2015

Interesting, support is actually further developed than I realized. As you can see below from the AcroForm example.

image

That said, still some issues. For example block input is currently unsupported

image

XFA is probably a whole new kettle of fish and more complicated to support. For now however, solid a solid AcroForm implementation might be a nice win

@1ec5
Copy link

1ec5 commented Feb 17, 2015

That acroforms example relies on a forms.js that’s included in the example but not in the normal viewer. For what it’s worth, Preview.app does the same thing with block input:

preview app

@wamatt
Copy link

wamatt commented Feb 17, 2015

@1ec5 good point on preview.

While we making comparisons, it's interesting to see Chrome/Blink perform really well.

image

Block letter support and proper color/shading.

I suspect that might be because Chrome is using an Adobe plugin rather than their own rendering library?

@timvandermeij
Copy link
Contributor

It's really good to hear that you are interested in further developing this feature. I think the best implementation reference would be section 8.6 from the PDF specification: https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf#page=671&zoom=auto,-306,313

forms.js is an example implementation, but as you can see it is not complete, nor does it do everything described in the specification. I think that's also the reason that it is not yet included in the PDF.js core. In order to be able to include it in the PDF.js core, the existing code has to be rewritten in a more object-oriented way and it should support most of the features used in the found PDF files.

If you would like help with this, you can always reach us on IRC (irc.mozilla.org, #pdfjs) or ask here.

1ec5 added a commit to 1ec5/pdf.js that referenced this issue Mar 14, 2015
Also cleaned up some styling code.

For mozilla#1459
@joepie91
Copy link

For what it's worth, I've had a user of PDFy request this functionality for a registration form.

@wscalf
Copy link

wscalf commented Aug 3, 2015

Somewhat random, and possibly off-topic question: what about adding support for more of the properties of widget annotations? As it is, the AcroForms sample demonstrates how to add basic fillable form functionality when rehosting pdf.js, but anything beyond the basics isn't really possible because the annotations returned from getAnnotations() are missing properties (sometimes vital things, like the options in a choice control.)

While it would require a pretty robust solution in order to offer fillable forms in the viewer (ie: to users), simply expanding the data available via the public APIs would be useful to people like me who are rehosting/expanding on it (based on the AcroForms sample), and would also chip away at the core work that would need to be done to support forms completely. ..If that makes sense.

My schedule for the next while is a bit dicey, but I might be available to work on it. I also noticed there's a fork of pdf.js here: https://github.com/mainegreen/pdf.js that has a lot of that functionality already, but it's a few hundred commits behind and the current version crashes on choice controls.

Thoughts?

@timvandermeij
Copy link
Contributor

@wscalf We agree that that would be useful and we are tracking that request in #5283. Indeed a bit off-topic here, so any discussion should occur in that issue from now on. Thanks!

@fbender
Copy link

fbender commented Nov 16, 2015

We have seen telemetry results and asked users, but there was not much demand for AcroForms support.

This may be a chicken-egg-problem. People will download PDFs instead of opening them in Fx because they cannot edit them, or websites will force-download to work around this issue with browser sniffing. Since browsers are retiring NPAPI and thus the Acrobat Plugin next year, this method will only advance. Additionally, a 2% usage figure is huge considering the overall amount of Fx users, and does not take into account further uses of pdf.js as well as people that disabled pdf.js in favor of the Acrobat plugin, which is highly likely for people having to deal with forms in PDFs on a regular basis. Also, more up-to-date information would be nice.

This issue should be top priority right now since (almost) all other major browsers (relative to market share) do support forms in one form or the other, and NPAPI plugins will be deprecated. Furthermore, some OSes do not support forms in PDF natively, leaving an opportunity for a unique selling point.

@Hyangyong
Copy link

I think some problem can be fixed if you go and watch to the site named www.smarttest.kr.
Radiobutton,textbox and submit control are good working now. These samples are for students to test on internet and to score.

@MickL
Copy link

MickL commented Jun 3, 2016

Any news / status updates on this issue? :)

@timvandermeij
Copy link
Contributor

Not yet. There is an open PR for some of this functionality, but it is a work in progress.

@timvandermeij
Copy link
Contributor

Closing as duplicate of #7613, in which we now track interactive forms (AcroForms) support. Parts of this feature have already been merged and the other parts are tracked there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests