Protocol error (Page.printToPDF): paper width is zero or negative
-
Hi Got the following error when i ran a report
Protocol error (Page.printToPDF): paper width is zero or negative
ProtocolError: Protocol error (Page.printToPDF): paper width is zero or negative
at new Callback (/var/www/html/jsreport/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:62:35)
at CallbackRegistry.create (/var/www/html/jsreport/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:108:26)
at Connection._rawSend (/var/www/html/jsreport/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:224:26)
at CDPSessionImpl.send (/var/www/html/jsreport/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:433:78)
at CDPPage.createPDFStream (/var/www/html/jsreport/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js:738:88)
at CDPPage.pdf (/var/www/html/jsreport/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js:771:37)
at /var/www/html/jsreport/node_modules_old/@jsreport/jsreport-chrome-pdf/lib/conversion.js:382:27
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /var/www/html/jsreport/node_modules_old/@jsreport/jsreport-chrome-pdf/lib/conversion.js:423:22Can you say why this error came ? and how to fixs it ?
-
You either send in your API request template specification with
template.chrome.width
some negative number or you have it stored on the template:In the first case you need to make sure to send positive number, on the second case you need to update the template with positive number. In case you see no value in pdf width and want to use the default, please save it with some positive number, remove it and save again.