OthelloAdmin
OthelloAdmin

Reputation: 75

Parsing PDF Form Data in Browser using Javascript

I'm working on a web app that needs to deal with filled PDF forms (converting to a web form is not an option in this situation, since I'm dealing with digitally signed PDFs).

The app needs to upload a PDF, parse the form data from the PDF into JSON, and then upload the PDF as an attachment to a CouchDB server.

Parts 1 and 3 are easy, but I have not been able to find a way to extract PDF data in browser.

As I see it, I have three options:

  1. Implement or find a web service (possibly a node service using something like pdf2json). Send the PDF out via AJAX, get formatted JSON data back. I'd rather not do this, since it requires an "extra" web service call, but can if I need to.

  2. Find a library that can handle PDF parsing in browser (from blobs/base64-encoded data), and implement using that.

  3. Convert a node.js module like pdf2json to something available in browser using browserify or similar.

Has anyone implemented PDF form parsing in browser? Or do I need to implement the web service?

Upvotes: 3

Views: 3653

Answers (1)

Lou Franco
Lou Franco

Reputation: 89192

Not sure if this can get forms, but PDF.js already works in browsers.

Upvotes: 1

Related Questions