Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting higher resolution with casper #83

Open
stevepowell99 opened this issue May 22, 2019 · 1 comment
Open

setting higher resolution with casper #83

stevepowell99 opened this issue May 22, 2019 · 1 comment

Comments

@stevepowell99
Copy link

I'm using webshot to export high-resolution images from visNetwork but struggling to improve the resolution beyond FHD. I've tried this:

webshot::webshot("export.html", file = "p.png", vwidth = 1980, zoom=1,  eval = '
    casper.then(function () {
            window.screen = {
                width: 4096,
                height: 2304
            };
        });
    
;')

... but nothing seems to make any difference (not even setting zoom = 2). The best I can do is just:

webshot::webshot("export.html", file = "p1hix.png", vwidth = 1920,zoom=1)
The best result I can get is, I think, at the resolution of my actual browser. The export.html file seems fine, there is nothing restricting the width of the canvas. Is there any way I can set webshot to simulate a higher resolution screen?

@wch
Copy link
Owner

wch commented Aug 7, 2019

You might want to try out webshot2. You'd do something like:

webshot2::webshot("export.html", vwidth = 4096, vheight = 2304)

https://github.com/rstudio/webshot2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants