| browser_print {xfun} | R Documentation |
Print a web page to PDF/PNG/JPEG
Description
Print a web page to PDF or take a screenshot to PNG/JPEG via a headless browser such as Chromium or Google Chrome.
Usage
browser_print(
input,
output = ".pdf",
args = "default",
window_size = c(1280, 1024),
browser = env_option("xfun.browser", find_browser())
)
Arguments
input |
Path or URL to the HTML page to be printed. |
output |
An output filename. If only an extension is provided, the
filename will be inferred from |
args |
Command-line arguments to be passed to the headless browser. The
default arguments can be found in |
window_size |
The browser window size when taking a PNG/JPEG screenshot. Ignored when printing to PDF. |
browser |
Path to the web browser. By default, the browser is found via
|
Value
The output path if the web page is successfully printed.
Examples
xfun::browser_print("https://www.r-project.org")