3 ms·
I briefly looked at running Javascript inside PDF a couple of years ago - I think this is possible under the spec, but no major renderers allow it. Could be wr
by avinium 8y ago
I briefly looked at running Javascript inside PDF a couple of years ago - I think this is possible under the spec, but no major renderers allow it.
Could be wrong.
- gumby 8y ago> I think this is possible under the spec, but no major renderers allow it. Thank goodness, though I suppose you could take the position that you already have a full programming language in your document so how could this be worse? Though the idea of distributing node with all my documents seems a bit hairy.
- DanielDent 8y agoPDFs that work in Chrome's PDF renderer: A calculator: https://pspdfkit.com/images/blog/2018/how-to-program-a-calculator/calculator.pdf https://pspdfkit.com/images/blog/2018/how-to-program-a-calcu... A game of breakout: https://github.com/osnr/horrifying-pdf-experiments/raw/master/breakout.pdf https://github.com/osnr/horrifying-pdf-experiments/raw/maste... The PDF specification is hundreds of pages.
- WrtCdEvrydy 8y agoI wonder if running PouchDB would count... since it's an offline / online database. I'm wondering if having a PDF that would have data that could self-update if there's an internet connection. Anyone wanna collaborate on something like this? I wonder if having a PDF like this that showed you how your stocks of choice are doing would be interesting.
- yomly 8y agoWould would be the advantage of this over a website/PWA? That it's more portable? It's more document-like/printable?
- WrtCdEvrydy 8y agoSelf-contained, no need for internet unless you want it to update, is forward-compatible with future PDF readers.
- avinium 8y agoOh wow - I wonder if this was added to Chrome's PDF engine after I looked into it. Very cool, but a bit concerning at the same time. I have vivid memories of Flash exploitations and all the malware that came with it. I know we've moved on since then, but I still don't see any reason to allow dynamic content in a page layout format.
- heavenlyblue 8y agoOn Firefox calculator opens up, but I can't interact with the elements. The second one is an empty page. I suppose it needs to do some initialization first in order to show the page.
- kulu2002 8y agoThis is amazing.
- jsjohnst 8y agoIf there is one who would, it’d be Adobe Acrobat / Reader, but I don’t think even it does either.