3 ms·
Is there even a single solid motivating example for why JS in PDF is useful? Can anyone show a real-world application of JS in PDF where it's actually a good f
by 0xDEAFBEAD 2y ago
Is there even a single solid motivating example for why JS in PDF is useful? Can anyone show a real-world application of JS in PDF where it's actually a good fit?
I just don't see why PDF would be your file format of choice if you're writing JS.
- zoom6628 2y agoIt is allowed by the PDF/A-3 standard which lets you embed data and script into a PDF. And this is used as the archive standard for PDF files sent in electronic invoicing in a number of countries. Basically you get a human readable file containing the data presented and its digitally signed so your data matches the readable presentation.
- magnat 2y agoWe have tax forms available as interactive PDFs, which: * auto-computes formulas * enables and disables whole sections of the document depending of filled values * performs complex validation, beyond checking for required fields and regexp patterns * offers inline help * can be filled, saved and printed completely offline * when printed, looks exactly the same as traditional, paper form * don't require external software beyond a PDF reader
- HeavenFox 2y agoNY tax form also generates a barcode from the information you entered to facilitate faster processing
- cookiengineer 2y agoWhy is this an interactive PDF in the first place?
- niutech 2y agoTo be able to print it and fill in by hand or by typing on a PC? To be able to save the filled-in form in a portable file?
- tomjen3 2y agoPDF forms - you can cut down on errors by using JS to enable/disable parts of the form based on users answers (e.g if not married, you are also not filling jointly in a tax form).
- tonyedgecombe 2y agoHasn't most of that moved to the web now.
- ale42 2y agoPDFs work offline, and they are designed to represent printable pages, so if the end document has some use on paper, or if you want to allow users to fill it as a document and to do it completely offline, it make sense to use PDF.
- paulddraper 2y agoSame reasons JS in HTML documents is useful?? Frontend form validation. Hide/show widgets, etc
- guleblanc 2y agoThe form used by the BOIR, (Beneficial Owner Information Report), which was supposed to be mandatory for all businesses in the US, uses some kind of scripting, which I suspect is JS. I had to spin up a Windows machine on Virtual Box to get the right version of Adobe Acrobat to fill it in, as Adobe dropped support for Linux years ago. Why the CFPB didn't just create an SPA or a web form for this is a mystery to me. The BOIR is an important tool for helping investigate money laundering. Its constitutionally is in doubt, apparently by people who think money laundering is a good thing.