Closed gief closed 7 years ago
I've tested the hardcoded solution above, and it does return 1600x1200 on the screen resolution site.
option b) with adding window-size conditionally, seams to be good solution
Does this affects visual rendering? I think this only changes variables available through javascript, and it isn't affecting actual rendering resolution.
Some CSS rules depend on the window size to change the rendering. A big one is Bootstrap, as can be seen here: https://stackoverflow.com/questions/26628388/twitter-bootstrap-prints-in-xs
Bootstrap features responsive CSS that will detect the window size and resize special "columns" accordingly. So, if a Bootstrap website is printed with a 800x600 resolution, the CSS rules will default to essentially a "mobile-view".
FYI, I updated the original comment with proposed code
Resolved by #14
The 800x600 screen resolution is a restriction on how the page prints to pdf for a number of sites. Can we either hard-code a larger screen resolution or pass on a variable to fix this?
Example: chrome-headless-render-pdf --url https://www.whatismyscreenresolution.com/ --no-margins --pdf screen.pdf Result: 800x600
Request: (a) hardcoded screen resolution at a larger standard size.
(b) flag for screen resolution I believe this would require:
string: ['url','pdf','chrome-binary','window-size'],
var [x,y] = "window-size".split(',');
"--window-size="+x+","+y