jpetso / formstamper

Formstamper: work-in-progress GUI application (using Electron) for batch filling PDF forms
GNU General Public License v3.0
1 stars 1 forks source link

Revamp Formstamper with use of webpack, PDFium and more node-pdftk #31

Closed jpetso closed 4 years ago

jpetso commented 4 years ago

Apart from updating all the packages in the yarn.lock file, this update was produced by creating a brand new scaffolding with electron-forge (v6.0.0-beta.52 replacing the old v5) and its webpack template. I then merged all the changes until it worked again like before.

One thing that we're getting out of this is a recent electron. This allows us to use Chromium's PDF functionality (Pdfium) to replace pdf.js and the node-canvas implementation we relied on for creating the preview picture. From there, it's not far to also replace the functionality for extracting field info, something that node-pdftk had rudimentarily provided but only as difficult-to-parse original pdftk output buffer. I adapted an existing pull request, tweaked it and now Formstamper can read form field names and values directly via node-pdftk.

So now we have the same functionality as before, but without dependency on pdf.js and a number of legacy modules that got thrown out with the update to webpack and electron 9. From here, we can start improving the UX again.