Live data from Hacker News

Embedded PDF viewer in Firefox 81 supports filling forms

support.mozilla.org

361–370 of 384 posts

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#361

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!

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, dat…

I'm of a similar opinion but I'll say the format is quite good, but the many and varied implementations are often not.

A common case is clients who use utilities that generate single customer documents then merge them into a bigger file for bulk print and mail (bills and statements, not identical copy). Without fail that results in thousands of similar but different subset fonts whereupon most printers I've encountered eventually fail due to memory issues.

Typically this leads to a discussion about "I can open it on my computer fine" and bending over backwards to find a workaround. Merging and consolidating these fonts doesn't seem to be a simple task, although some tools claim to work some of the time.

Something that scopes object resources for disposal could be nice in the PDF spec (maybe it exists), but something like a LRU caching mechanism on the printer would potentially resolve this too.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#362
post #268

Earlier quoted context omitted.

More. Go here and download the PDF spec.: https://www.adobe.com/devnet/pdf/pdf_reference.html Look at Chapter 3, Syntax. The code is all text based. We are not talking about the visible characters in a PDF viewer, but the code of the PDF file itself.

Oh, true. I misread, and also didn't know that. Thanks for the info!

Going by your original premise though, just so you know the reference does indeed have examples of text as strings e.g.

BT /F13 12 Tf 288 720 Td (ABC) Tj ET

This can be extended to include spaces so you can essentially mark up entire lines of text at one time. What it can't do is cohesive paragraphs and flow/wrap, you need to use the relative positions to work out what text is in one block (and usually I'd defer to something like pdftotext for simple cases).

Laying out individual characters is common though. It's probably due to kerning concerns.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#363
post #329
post #312

Earlier quoted context omitted.

Yup! Keep running into having no way to fill in Canadian Government forms. It's all XFA.

Example? There are ways of converting XFA forms to Acroforms...

Fwiw, I converted this random CA secured XFA form to an unlocked Acroform in a few seconds.

From https://www.canada.ca/en/revenue-agency/services/forms-publi... to

https://slack-files.com/T02FQ9S94-F01BA4CS9QA-a692aafd70

Only difference I can see is the "Clear Data" scripted js button no longer works.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#365
post #363
post #329

Earlier quoted context omitted.

Example? There are ways of converting XFA forms to Acroforms...

Fwiw, I converted this random CA secured XFA form to an unlocked Acroform in a few seconds. From https://www.canada.ca/en/revenue-agency/services/forms-publi... to https://slack-files.com/T02FQ9S94-F01BA4CS9QA-a692aafd70 Only difference I can see is the "Clear Data" scripted js button no longer works.

How do you do this exactly? Would be helpful to know

Re: Embedded PDF viewer in Firefox 81 supports filling forms

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

It's kinda crazy that this is the format we've standardized on to carry all of the output of academia into the future.

Actually, it’s not. The archiving standard is PDF/A, which is (as I understand it) much more structured and standardized.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#367
post #106

Earlier quoted context omitted.

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.

IIRC the original doc (and xls) formats were unwieldy mainly because of performance requirements. In order to save and load fast they were basically a bunch of binary dumped structs.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#368

Earlier quoted context omitted.

with the previous format being essentially a memory dump, i'd say that's progress

That’s correct - I worked with MS team that documented old formats, and they said that sometimes they don’t have people left who knew what specific struct was intended for - although that was mostly for people PowerPoint and Visio, excel and word was better documented

Actually Excel was the only one that had official, freely available documentation for the old (now legacy) file format.

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#369
post #365
post #363

Earlier quoted context omitted.

Fwiw, I converted this random CA secured XFA form to an unlocked Acroform in a few seconds. From https://www.canada.ca/en/revenue-agency/services/forms-publi... to https://slack-files.com/T02FQ9S94-F01BA4CS9QA-a692aafd70 Only difference I can see is the "Clear Data" scripted js button no longer works.

How do you do this exactly? Would be helpful to know

Unlock form in multiple ways (easy to google). Convert to acroforms using Acrobat Pro using the extract function.

https://imgur.com/a/3mAi3l0

Will remove XFA "capabilities", but otherwise works...

Re: Embedded PDF viewer in Firefox 81 supports filling forms

#370
post #369
post #365

Earlier quoted context omitted.

How do you do this exactly? Would be helpful to know

Unlock form in multiple ways (easy to google). Convert to acroforms using Acrobat Pro using the extract function. https://imgur.com/a/3mAi3l0 Will remove XFA "capabilities", but otherwise works...

This is really helpful, thank you! Will make my citizen ship application a lot easier :D
Post reply on HN