Closed doonfrs closed 2 months ago
I tracked the code, I found that the PHP code passes the options successfully to puppeteer puppeteer does not respect the viewport options for PDF.
The solution found here: https://github.com/puppeteer/puppeteer/issues/1183
I edited Convert.js changed
_launchBrowser()
{
return puppeteer.launch({
ignoreHTTPSErrors: true,
args: ['--no-sandbox', '--disable-web-security']
});
}
to
_launchBrowser()
{
return puppeteer.launch({
ignoreHTTPSErrors: true,
args: ['--no-sandbox', '--disable-web-security','--window-size=1440,600']
});
}
Now screen page rendered in 1440 screen width, before that page appears in mobile screen.
Thanks for the report and the research. Indeed, it seems like this is a Puppeteer issue. We'll need to wait for a fix being provided there.
Hi; I used the following options to generate pdf
PDF output:
screen.width = 800screen.height = 600
Version: "spiritix/php-chrome-html2pdf": "^1.4"
OS: Centos 7