Live data from Hacker News

Embedded PDF viewer in Firefox 81 supports filling forms

support.mozilla.org

81–90 of 384 posts

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#81
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!

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!

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#82
post #66

Earlier quoted context omitted.

> It has plenty of advantages over HTML but they're easy to dismiss if you don't have a use case for them. Can you discuss some of the advantages? The only advantage that comes to mind is that Apple has built-in support for writing PDFs and that has a lot to do with Adobe rather than PDF being a better candidate.

I work for US Federal courts, I can assure you html isn’t sufficient over PDF’s for court cases. Evidence are filed in pdfs. Documents (PDFs) need to be a historical archive, and the ability to modify would damage the credibility of those documents.

> ability to modify

How are PDFs any less modifiable than HTML other than requiring (widely available) specialized tools instead of a text editor?

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#83

Earlier quoted context omitted.

Did anyone try to pluck out PDFs from /dev/urandom? How about from radiotelescope feed? Maybe the first evidence of extraterrestrial life will be some poor alien's tax form?

The digits of pi contain every pdf that ever could and ever will exist.

Well maybe. We don't know if pi is a normal number.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#84
post #66

Earlier quoted context omitted.

I work for US Federal courts, I can assure you html isn’t sufficient over PDF’s for court cases. Evidence are filed in pdfs. Documents (PDFs) need to be a historical archive, and the ability to modify would damage the credibility of those documents.

Yeah, but does Firefox need to solve the use-case of a court system? Also, tangentially the solution to guarantee "tamperproof" archiving is in cryptography and that's not a feature of PDF.

No, Firefox doesn’t need to support the use case of a court system. That’s not what GP is saying. All we’re establishing here is that PDF is a useful format, and Firefox is supporting it.

Also, cryptographic signatures do happen to be a feature of PDF.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#85
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!

In the early 2000 I coded a PDF library for an industrial printer suite. (Print, proof, impositions)

I personally think the structural PDF format is a really great format. It's entirely ASCII-based, a pure text format, yet it can embed arbitrary binary data and compress that data. The actual structure is simple and support just enough functionality, like a tree of object, dictionaries and arrays, unicode strings, date formats, etc.

I think if you limit yourself to pure structural PDF woulde have been a great format to standardize upon, much better than JSON or XML. It';s richer than JSON, simpler and saner than XML. Again, it's top-notch ability to embed binary is great. It has other great characteristics, for example you can update anything just by appending.

The ugly bits are in the "semantic" PDF: the page descriptions, media, etc. Even then, the early version of PDF were nice, mainly just simplified Postscript.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#86

Is there something hard about fillable forms on PDF? Why have a PDF viewer at all if it couldn't fill out a form?

Yes! PDF forms are amazingly complex. Text in PDF is very complex and the forms themselves are a kind of templated vector graphics. Multiply this by all the weird and corrupt PDF forms out there which Acrobat support and you have a challenging task.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#87
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.

OK, they added various ways of data compression, but PDF is, basically, a text-based format.

As far as I know, any PDF can be losslessly converted to an equivalent PDF that can be edited in any text editor, even Notepad. And yes, you could fill in the forms there, too (if you were stubborn enough)

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#88

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'…

Hey! Polarized looks pretty cool. Question, has this feature (forms) been merged into the public pdf.js master yet?

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#89
post #46
post #33

Earlier quoted context omitted.

Printing is one use case. Also plenty places that want filled out forms uploaded, e-mailed, ... + it allows you to keep a copy with what you entered.

That's my point. Other than printing a nice looking form (which includes faxing), the content of the field data is hard to reuse. Searching PDF content on your own hard drive is problematic. Are there utilities that extract PDF field data and submit it to a database? I'd be grateful to see examples. What about field validation? The PDF may have some minor validation, but that's no substitute for the validation done i…

Sure, its a structured format, so you totally can extract the individual fields. AFAIK Adobe sells a server product that does that, but I'm sure there's competitors and I have seen the underlying parsing in feature in PDF libraries before.

That said, plenty of users of PDFs have a very paper-based/manual workflow still, and not the motivation and expertise to run and update an online form thing. Or they need to have the ability to handle odd inputs anyways, because paper forms have even worse input validation.

And from a browser/user perspective, the feature here is useful because people expect me to handle PDFs and do not provide nice web forms. They might have terrible reasons for doing so, but I still need to live with that.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#90

Earlier quoted context omitted.

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

As someone working on formats, I disagree with your generalization. But let's get into specifics. List the things about PDF that you believe can't be done with web pages?

Going to a particular page and only having to render that one page. Large HTML documents are unwieldy.
Post reply on HN