Pagedjs CLI: Freshly installed pagedjs crashes with the --styles tag added
Hello, I'm a beginner with this tool and it seems really promising!
I'm doing a local project for myself and want to output custom html to pdf files for download, the file I'm testing with is extremely simple:
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
</head>
<body>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0">
<span style="font-family: arial; font-size: 14.6px">this is </span>
<strong>
<span style="font-family: arial; font-size: 14.6px">another</span>
</strong>
<span style="font-family: arial; font-size: 14.6px"></span>
<span style="font-family: arial; font-size: 14.6px; color: #FF0000">footnotes</span>
<span style="font-family: arial; font-size: 14.6px"> test</span>
<footnote data-footnoteid="vn3Ve6me6WpVJsQPiqzxmH" contenteditable="false"></footnote>
</p>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0"></p>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0"></p>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0"></p>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0">
<span style="font-family: arial; font-size: 14.6px">this is another test</span>
<footnote data-footnoteid="3hjvxRpN4LKEdagHYU6Y7r" contenteditable="false"></footnote>
</p>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0"></p>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0"></p>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0"></p>
<ul>
<li class="">
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0">
<span style="font-family: arial; font-size: 14.6px">a</span>
</p>
</li>
<li class="p-indent-1">
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0">
<span style="font-family: arial; font-size: 14.6px">b</span>
</p>
</li>
<li class="">
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0">
<span style="font-family: arial; font-size: 14.6px">c</span>
</p>
</li>
</ul>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0"></p>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0"></p>
<div style="display:block; clear:both; page-break-after:always;"></div>
<p style="line-height: 1.4; letter-spacing: 0px; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px" data-linetypestep="0">
<span style="font-family: arial; font-size: 14.6px">this is a test</span>
<footnote data-footnoteid="jfzFxRAFvysLzvxUoa2fVj" contenteditable="false"></footnote>
<span style="font-family: arial; font-size: 14.6px"> pig</span>
<footnote data-footnoteid="4UDIpS7KVEEyAoX752ArA9" contenteditable="false"></footnote>
<span style="font-family: arial; font-size: 14.6px"> aa</span>
</p>
<div style="display:block; clear:both; page-break-after:always;"></div>
</body>
</html>
As you can see, nothing weird added! I'm using node and running this command using exec:
pagedjs-cli --style "C:\wamp64\www\lw2\mycustomproject\src\public\stylesheets\pdf.css" -i "C:\Users\John\AppData\Local\Temp/prefix--11796-YriDX9BR1UJz-.html" -o "prefix--11796-YriDX9BR1UJz-.pdf"
this is hosted on a local node server, so when I do the request I generate the html file I typed earlier, create it in the temp folder and proceed to run that command, this error appears:
I've debugged this and found it this is the whole error its giving in puppeteer this is on puppeteer-core\lib\esm\puppeteer\common\ExecutionContext.js:
this is the error as JSON:
{"exceptionId":1,"text":"Uncaught (in promise)","lineNumber":0,"columnNumber":0,"exception":{"type":"object","className":"ProgressEvent","description":"ProgressEvent","objectId":"8914632043116011032.3.3","preview":{"type":"object","description":"ProgressEvent","overflow":true,"properties":[{"name":"isTrusted","type":"boolean","value":"true"},{"name":"lengthComputable","type":"boolean","value":"false"},{"name":"loaded","type":"number","value":"0"},{"name":"total","type":"number","value":"0"},{"name":"type","type":"string","value":"error"}]}}}
Any help will be appreciated, it seems like it does not want to accept my .css file ("C:\wamp64\www\root\mycustomproject\src\public\stylesheets\pdf.css")
If I remove the --style command it works just fine.