News for hackers. Stuff that matters.
Re:PDF Is the World's Most Important File Format by arcticbull on Friday May 03, 2019 @05:18PM (#19822372)
Some features, not all of them. Forms in particular are poorly supported in the Apple stack, and specifically, it can't generate QR codes from form fields in documents like Reader can. Fonts are usually inconsistent and wrong in forms. Letter spacing is all wrong. I'm sure there's tons of other things missing, the spec is ginormous and includes it's own version of JavaScript that's similar to -- but not quite -- ECMA which is a huge attack vector [0].

For instance, check out the Canadian passport simplified renewal form [1]. The upper-right corner on the first page is "$FORM$054(06-2018)$V$1.4$CS$0$C$0" on the Apple stack and a proper QR code which changes as you fill in the application in Reader. The big blue "Read Instructions" buttons don't work on the Apple stack either.

It may be important, but it's a waking nightmare of a spec.

[0] http://mariomalwareanalysis.blogspot.com/2012/02/how-to-embe...

[1] https://www.canada.ca/content/dam/ircc/migration/ircc/englis...

Re:PDF Is the World's Most Important File Format by mwfunk on Friday May 03, 2019 @08:14PM (#19823381)
Originally there were AcroForms, part of the PDF spec. That's supported by pretty much everyone.

Then, Adobe saw an opportunity make some enterprise money and introduced XFA (XML Forms Architecture). The XFA spec is associated with the PDF spec, and you can put XFA content inside of a PDF, but the XFA spec is actually larger than the PDF spec. It's utterly insane.

I know that Adobe of course supports XFA, and there are various enterprisey things that support it to varying degrees, but I don't think it's well-supported by anyone outside of Adobe's implementation. Not only is it huge and complicated, but it also requires pulling in a JavaScript interpreter, which is a big ask for a feature that only exists because at one time Adobe thought they could turn it into another revenue stream.

It's noteworthy that the PDF 2.0 spec specifically says that XFA is not only deprecated, but that any PDF which contains XFA content is considered out of spec for PDF 2.0. 2.0 goes back to AcroForms for all of that stuff and ditches XFA entirely. Likewise for JavaScript in general. Anything with JavaScript dependencies in PDF 1.7 is verboten in 2.0.

In general, if you get stuck with a PDF with XFA content (not AcroForms), your best bet is to just use Adobe Reader to fill it out. Hopefully PDF 2.0 will take over the world eventually and everybody will be 100% back on AcroForms.

Re:PDF Is the World's Most Important File Format by arcticbull on Friday May 03, 2019 @09:01PM (#19823585)
I'm surprised to hear they're getting rid of JavaScript (and I couldn't find any references to that, but I wish it to be true) -- but don't worry, they're adding a whole new pile of complexity in PRC. "PDF 2.0 adds support for “PRC”, a rich 3D modeling language, originally developed by Adobe." [1]

[1] https://theblog.adobe.com/taking-documents-to-the-next-level...

Re:PDF Is the World's Most Important File Format by Stratoscope on Friday May 03, 2019 @11:29PM (#19824245)
> I'm surprised to hear they're getting rid of JavaScript (and I couldn't find any references to that, but I wish it to be true)

I won't believe it until I see hard evidence. Acrobat and Reader have supported JavaScript for something like two decades. (I wrote a bunch of JavaScript multimedia APIs when I worked there around 2002.)

Consider the large number of interactive PDFs on the IRS website that use JavaScript for form calculations. I don't think Adobe is highly motivated to break all of those.

Re:PDF Is the World's Most Important File Format by blotter_paper on Saturday May 04, 2019 @01:43AM (#19824694)
I've seen some embedded SVGs get rendered differently by different PDF readers.
Re:PDF Is the World's Most Important File Format by sfkdjf9j3j on Friday May 03, 2019 @06:16PM (#19822751)
Not that you're wrong about the PDF spec being monstrously complex and not universally supported, but why would someone want to generate a QR code from form fields? Who actually wants to use QR codes?
Re:PDF Is the World's Most Important File Format by gibolt on Friday May 03, 2019 @08:40PM (#19823490)
Anyone in Asia, they are hugely popular and super useful.

Adding friends on WeChat, making payments to vendors, getting discounts, installing an app, etc

Re:PDF Is the World's Most Important File Format by geomark on Friday May 03, 2019 @09:26PM (#19823688)
Yep. In my case add friends on Line, buy subway tix, pay at 7-11 and many other places. You can also receive payments to your own QR code.
Re:PDF Is the World's Most Important File Format by Karunamon on Saturday May 04, 2019 @12:51AM (#19824535)
If I understand right, they took off pretty much everywhere other than NA for public use. The general vibe I get here is that nobody in the country uses them, and using them is seen as a bit of an anomaly, even scanning one in public makes you a minor spectacle.
Re:PDF Is the World's Most Important File Format by dd36 on Friday May 03, 2019 @06:31PM (#19822837)
A machine that scans forms.
Re:PDF Is the World's Most Important File Format by arcticbull on Friday May 03, 2019 @06:32PM (#19822843)
Haha, fair, that was just the first painpoint that sprung to mind. They're fairly common on visa and passport applications, and some other government forms. I guess if you're accepting paper submissions for whatever reason not having to transcribe the contents is a big win.
Re:PDF Is the World's Most Important File Format by nerdbaggy on Friday May 03, 2019 @11:17PM (#19824192)
QR codes are also super useful in warehouses
Re:PDF Is the World's Most Important File Format by wingerlang on Saturday May 04, 2019 @02:35AM (#19824817)
Like people said, QR codes are huge in Asia. I got one just yesterday to get my movie ticket.
Re:PDF Is the World's Most Important File Format by afiori on Saturday May 04, 2019 @07:26AM (#19825802)
> Forms in particular are poorly supported

I understand this is a problem as it is one extremely important features of PDFs, but from a consumer perspective (never worked in an big office) I do not think I have ever seen a PDF form.

Maybe the real success of PDFs is that it managed to hide all the inner complexity of the format and missing features from the common use cases.

Re:PDF Is the World's Most Important File Format by sbr464 on Saturday May 04, 2019 @03:16AM (#19824965)
re: forms, I find it easier to just convert a pdf to an image or screenshot it programmatically, and process it with a few custom OCR APIs that identify key/value form structures. Unfortunately, I would say, but it works pretty well.