rstudio / webshot2

Take screenshots of web pages from R

Home Page:https://rstudio.github.io/webshot2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature request: pdf format support the output page size

Liripo opened this issue · comments

commented

repex:

require(visNetwork, quietly = TRUE)
# minimal example
nodes <- data.frame(id = 1:3)
edges <- data.frame(from = c(1,2), to = c(1,3))
net <- visNetwork(nodes, edges, width = "100%")

library(htmlwidgets)

saveWidget(net,"net.html")

webshot2::webshot("net.html",file = "net.png",vwidth = 600,vheight = 400,cliprect = "viewport")

webshot2::webshot("net.html",file = "net.pdf",vwidth = 600,vheight = 400,cliprect = "viewport")

Now the fixed output format of pdf is A4format, if possible, hope to support custom page size.

commented

s$screenshot_pdf(filename = file, wait_ = FALSE)

It would be great if the parameters of screenshot_pdf could be exposed.