pagedjs-cli produces doubled output when HTML source includes paged.polyfill.js script tag
It seems that if the HTML source includes paged.polyfill.js
in it, then the command-line tool produces doubled pages. Here is a MWE:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
</head>
<body>
Hello world!
</body>
</html>
Then:
$ pagedjs-cli mwe.html -o mwe.pdf
✔ Loaded
✔ Rendering 1 pages took 10.199999988079071 milliseconds.
✔ Generated
✔ Processed
✔ Saved to /path/to/mwe.pdf
$ pdfinfo mwe.pdf
Creator: Chromium + Paged.js
Producer: Skia/PDF m93
... (removed some output)...
Pages: 2
I am trying to use pagedjs-cli
to generate invoices. I want to be able to preview them in the browser prior to rendering them as pdfs, so I need to include the script tag.
It's an acceptable workaround to simply have two templates, one for the browser that does include the script tag and one for generating the pdf, so this isn't high priority for me. I just thought you might like to know.