Hacker News new | ask | show | jobs
by eat_veggies 2064 days ago
can pdf?
1 comments

Given that PDFs can embed JavaScript, they can embed ad tracking software, yes. And Linux VMs. And a port of WinAmp.
I don’t think any of that is possible with the JavaScript APIs exposed (if any) by common PDF readers. I’ve tried to do useful things with JavaScript in a PDF and failed utterly. https://stackoverflow.com/questions/32597283/can-javascript-...
Paizo uses JS to trigger map layers (for RPG products)
Tracking is one possible problem. The other is, that JavaScript can modify the document itself, so a part of a contract for example might print out differently depending on conditions.

That's why PDF/A for archiving was created which disallows various components, cf. https://en.wikipedia.org/wiki/PDF%2FA

I didn't know they could embed javascript. That's horrifying.
Fortunately many PDF viewers don't run them.