Live data from Hacker News

Embedded PDF viewer in Firefox 81 supports filling forms

support.mozilla.org

101–110 of 384 posts

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#101
post #29

Earlier quoted context omitted.

Yes, maybe generally; but let’s talk about the specific case here — filling of complex PDF forms. When a PDF that has interactive form fields, calculated auto-populated fields, fields that are enabled/disabled according to the inputs of other fields, etc. — the organization that created it (usually government or education) usually does that because they want you to fill it out using a PDF viewer; save it (which will…

> In fact, many such “fillable” PDFs start off in a state with many of their form-fields disabled and voided, such that printing them out in that state would result in a form you can’t really write on! I have never seen this. Do you have an example? Every use if fillable PDFs I have encountered is a use case where submitting a handwritten form is still an option. > The only benefit a client gets is the ability to edi…

> I have never seen this. Do you have an example?

I don't have one on-hand, no. But I've certainly had to fill them out in the past. IIRC an especially-bad one came in the form [heh] of a student-loan application for the college I attended. It was essentially a Hypercard stack in the guise of a PDF.

Here are some early Adobe marketing materials (as a PDF, because of course it is) talking about the advantages of "eForm Solutions": https://planetpdf.com/planetpdf/pdfs/pdf2k/02E/ldefurio_pdff...

It sounds like every PDF form you've ever dealt with is what Adobe, in this brochure, calls a "Type 1: Print and Fill" or "Type 2: Fill and Print" form. But Type 3 and Type 4 forms do exist in the wild! (They're not often created any more; most of the ones that exist now are from around a decade or two ago, when Adobe was really pushing this idea.) Creating such forms was basically the point of Acrobat as a software product.

When PDF viewers (e.g. Apple Preview) say they don't support "PDF forms", they're not talking about Type 2 forms. They usually support those just fine. They're talking about Type 3 and Type 4 forms. And more specifically, the ones that use Adobe's proprietary AcroForms data-embedding system, rather than the open-standard XFA data-embedding system.

(I could swear I saw an HN post about the horrors of AcroForms once, but I can't find it now.)

> I have yet to see a web form that actually saves a readable, properly-formatted, self-contained, easy to access, fully-offline copy.

To be clear, that was what I meant by the second qualifier, "as a file." Browsers support persisting the state of the form. Just, not as a file. They persist the state internally, when the form's author does the client-side Javascript work to enable that.

For the use-case where the user wants to stop filling out the form for now (e.g. because they don't have some required information on-hand), and then come back to it to finish it later, in-browser persistence works perfectly well.

Even cleaner, though, is just building a web-form as a wizard, where fields are submitted one-at-a-time, and you can also freely navigate to previously-filled "steps" to change your answers. That doesn't even require JavaScript; just pure 90s HTML-generated-on-the-backend. Most government sites that thought PDF eForms were a good idea, are now falling back to this approach.

> Also, I don't know what "employees" and "Intranet" has to do with anything.

Secure installations. The main use-case for fillable PDFs (as can be seen in Adobe's marketing brochure, where "government" is the core client) is a case where public or cloud solutions just aren't tenable, i.e. in secure government/military/etc. installations, where the workstations are air-gapped from the public Internet. In such a case, PDF forms can still be sent around via a local non-Internet-routable email server, for the workers there to fill in.

Today, this need can be served just as well by setting up a non-Internet-routable web portal for those same workers to use. But back in the 90s and 00s, "Intranet web portals" were a fancy thing only the most forward of IT bigcorps had on offer. They had Intranets, for sure, but they weren't hosting web-apps on them.

So, what did they do instead? Well, Adobe had two main competitors in the "eForm" market:

• Lotus Notes form documents, connecting to a Lotus Domino database server;

• Microsoft Excel sheets that use VBA to data-bind to an accessible Microsoft Access database file sitting on an SMB network share.

None of these "forms" were hand-submittable. They're all little self-contained interactive applications, that happen to look like forms.

AcroForms did have the fancy property, though, that the AcroForms application-PDF could generate or export a bog-standard output-PDF representing the filled form. But that's not actually a modified copy of the source PDF. That's the PDF using scripting to generate you another PDF, from scratch.

------

To be clear, I agree with all the stuff you're talking about; those are all valid use-cases for "PDFs" (i.e. encapsulated PostScript containers.) But they're not what I mean by "PDF forms." I mean the Type 3/4 forms referred to above. There's no reason, in the modern era, that one would implement one of these Type 3/4 "eForm solutions", instead of just putting up a webpage.

If you need an e-signature at the end, have them fill out the web form, then generate a raw PostScript PDF representing their inputs, and let them sign it by dropping a signature vector image on the dotted line in any standard PDF viewer.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#102
post #29

Earlier quoted context omitted.

There are lots of use cases for PDF where a web page is totally unsuitable.

Yes, maybe generally; but let’s talk about the specific case here — filling of complex PDF forms. When a PDF that has interactive form fields, calculated auto-populated fields, fields that are enabled/disabled according to the inputs of other fields, etc. — the organization that created it (usually government or education) usually does that because they want you to fill it out using a PDF viewer; save it (which will…

1. A webpage form requires a server to be up and running, which requires an IT person to manage it, separate from the dept making the form. PDF forms can be created by a person given the right tools (I think Word does it)

2. IT person + webserver costs have to included in the budget somewhere. Which can be a big problem.

3. The webpage form can fail, and the support for it has to be provided by the IT dept. If the PDF form fails, dept can handle it on its own, and will often accept a filled+scanned print out of the PDF form.

4. Adding to the point above, PDF forms degrade gracefully, If they don't work, or internet doesn't work, or someone is on holiday, you can still print, fill and hand them in person. Webpages can degrade catastrophically where you whole dept grinds to halt while the IT person tries to fix the problem.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#103
post #28

“After entering data into these fields you can download the file to have the filled out version saved to your computer.” What’s the use case? Printing out filled-in forms? But otherwise, who would want the PDF in electronic format? It doesn’t seem like a practical way for users to submit data.

Last year applying for jobs most places had a pdf form, if you were lucky it was an actual form too! So, filling the form and emailing it back is useful -- much better than trying to overwrite text with a PDF background; far better than printing the form, filling with a pen, scanning, then sending.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#104

Earlier quoted context omitted.

It's easy to dismiss things in their entirety and then require someone else to "prove you wrong". Why don't you prove you're right instead? Why don't you list all of things that PDFs can do that can also be done with web pages?

Sure, here's my list: everything + more. There's nothing a PDF can do that a webpage can't. In fact there are a hundred of things that a webpage can do, but a PDF can't. Including, form fields, input fields and seamless form submissions. Webpages can also do this: https://bubblin.io/cover/official-handbook-by-marvin-danig#f... Disclosure: It's my work.

Anyone can create a PDF form to capture data and signatures, email it to someone who can then fill it out offline, and then email it back. That's not something easily done with a webpage, and it's not something my mom can do.

PDFs are easy to make and easy to work with. Web pages aren't.

Your work is impressive, and why would anyone want that? Do you envision lawyers putting all their legal contracts into fancy flippy books?

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#105
post #15

I looked into coding PDFs once. Then I closed my MacBook (Pro) and went for a long walk into the ocean. I think I almost got to America, but then I turned and swam back again. Turnd out I had just fallen asleep and had a nightmare. I was actually just working with regular text files, and everything was fine.

What's your favorite PDF feature that causes a brain meltdown? I've read a few comments on HN how PDF is, well, not developer-friendly. If people are interested in providing some more examples here, I'd be curious to know!

- Remapping font tables to different characters for to reduce code usage.

- Clipping path logic, you can write text outside of it, which makes it effectively invisible yet it will show up if you try to extract the text.

- Anything regarding the graphicstate stack, it's a pain to debug.

- Extracting content from AcroForm/JS "XFA" forms

PDF is great format for printing, it's just a pain for pretty much everything else.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#106
post #71

Earlier quoted context omitted.

At least it's probably better than MS-Word's internal format ... (?)

Microsoft Word stores XML documents inside a zip archive. There is a detailed specification of the format available: https://docs.microsoft.com/en-us/openspecs/office_standards/...

I think he was talking about the classic .doc format which was a clusterfuck and not the open XML.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#107

Earlier quoted context omitted.

What's your favorite PDF feature that causes a brain meltdown? I've read a few comments on HN how PDF is, well, not developer-friendly. If people are interested in providing some more examples here, I'd be curious to know!

Acrobat can read fantastically corrupt PDF files none of which are covered by the spec. The endless surprises induce a special kind of madness. Streams just suddenly end? That’s ok. Totally corrupt xref tables? Ok. Incorrect image headers? Ok. Unrecognisably mangled Type1 font formats? Fine!

That's great because it creates client expectations regarding what my PDF application should support. Implementing the spec is not good enough, you have to do what PDFium or Adobe do.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#108

I'm the author of Polar ( https://getpolarized.io/ ) that uses PDF.js as its PDF backend. This is a somewhat big update for PDF.js which is kind of cool in that they haven't really been updating it as aggressively as they usually do in the last year or so. It's a bit frustrating to work with though. The entire concept of rendering a PDF via JS is fascinating but actually using the API has been a huge pain for us. We'…

I've been working on an internal tool for my company using the same library. It's saved me a ton of work, but my experience has been similar to yours. I've even had to lock in to a much older version for want of putting a lot more work on my plate since the API seems to have changed a fair bit. (well, between it and JSDOM which I am using to some rendering on the server). And like you I've had to write a bunch of the bindings/definitions myself or just reduce them to nil (declare module "yadda/yadday/thing" as any)—which is thankfully permissible since it just needs to be built once and run "forever" with near-zero need for feature additions, etc.

All to extract images in a routine fashion.

Just the same, I'm still immensely thankful they've published the library as OSS.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#109
post #95

I have a feeling this thread has a strong bias from highly automated valley life. In more provincial regions and even just much of Europe lots of forms have to be filled out and printed. It is not something you have to everyday or something, but the existing solutions suck massively. You either have to use Adobe, which requires Windows (or Mac, I suppose) and your firstborn or use some massively shady online service.…

Isn’t evince capable of this and the default PDF viewer on GNOME?

I have had evince fail render forms, but okular (the KDE default) has worked pretty well.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#110
post #105

Earlier quoted context omitted.

What's your favorite PDF feature that causes a brain meltdown? I've read a few comments on HN how PDF is, well, not developer-friendly. If people are interested in providing some more examples here, I'd be curious to know!

- Remapping font tables to different characters for to reduce code usage. - Clipping path logic, you can write text outside of it, which makes it effectively invisible yet it will show up if you try to extract the text. - Anything regarding the graphicstate stack, it's a pain to debug. - Extracting content from AcroForm/JS "XFA" forms PDF is great format for printing, it's just a pain for pretty much everything else.

This is also my list. Except for the forms, that's one I don't have to deal with.

My other one is the use of multiple subset fonts that are actually the same font with a different subset of glyphs that you want to merge back together.

Post reply on HN