dichovsky / pdf-to-png-converter

Library Convert PDF to PNG
MIT License
110 stars 26 forks source link

Error: render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead #30

Closed Nolesh closed 1 month ago

Nolesh commented 1 year ago

It works great on Windows 11, but when I try to run it in docker with debian:11-slim and node 18.x, it says:

Error: render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead.
    at PDFPageProxy.render (/home/site/wwwroot/server/node_modules/pdf-to-png-converter/node_modules/pdfjs-dist/legacy/build/pdf.js:4838:13)
    at pdfToPng (/home/site/wwwroot/server/node_modules/pdf-to-png-converter/out/pdf.to.png.js:74:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Could you fix it please?

dichovsky commented 1 year ago

It works great on Windows 11, but when I try to run it in docker with debian:11-slim and node 18.x, it says:

Error: render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead.
    at PDFPageProxy.render (/home/site/wwwroot/server/node_modules/pdf-to-png-converter/node_modules/pdfjs-dist/legacy/build/pdf.js:4838:13)
    at pdfToPng (/home/site/wwwroot/server/node_modules/pdf-to-png-converter/out/pdf.to.png.js:74:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Could you fix it please?

Please try v3