Print a web page from R

I can open a webpage from R:

shell.exec("http://stackoverflow.com/")

But how can I then print this web page, directly from R, as an xps or pdf file?

+4
source share
1 answer

You can call the wkhtmltopdf command-line tool , which is open source and cross-platform:

shell("C:\\wkhtmltopdf\\bin\\wkhtmltopdf http://stackoverflow.com so.pdf")

Remember to avoid backslashes!

+4
source

All Articles