Hacker News new | past | comments | ask | show | jobs | submit login

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.






We 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

NY tax form also generates a barcode from the information you entered to facilitate faster processing

It 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.

The 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.


PDF 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).

Hasn't most of that moved to the web now.

Same reasons JS in HTML documents is useful??

Frontend form validation. Hide/show widgets, etc




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: