Browser-side PDF to PNG conversion
Usage
import pdfToPng from "pdf-to-png";
const pngBlob = await pdfToPng(pdfBlob);
Take a Blob as its unique mandatory argument and returns another Blob.
Most of the time, the entry will be a very specific type of Blob, the File.
See here for a simple and self-contained implementation example (in a React context).
Caveats
Will only work within the context of a webpack-based project for now due to the hardcoded dependency to the webpack-configured version of PDF.js
Development
Release
yarn prepublish
git add lib/ && git commit -m "<version>"
git tag <version>
git push origin <version>
Process inspired by this comment.