While rendering webpage to pdf using phantomjs, how can I auto adjust my viewportSize to take full page width?
I am able to specify the page size correctly using the params as below: var page = require('webpage').create(); page.paperSize = { format: 'Letter, orientation: 'Portrait'}; The challenge that I am facing is that, I cannot get my web page to take the full width of the paper. This is how I can set the viewport size: page.viewportSize = { width: mybestfitwidth, height: mybestfitheight }; The challenge here is that I cannot figure out what mybestfitwidth should be. I can tell the width of my pdf page in inches, but I can't figure out what number of pixels would that be, because that depends on