.print_html_with_chrome | R Documentation |
Print a HTML fragment using chrome
.print_html_with_chrome(
htmlFragment,
pdfFile = tempfile(fileext = ".pdf"),
css = list(),
chromeBinary = getOption("ggrrr.chrome", default = .find_chrome()),
maxWidth = NULL,
maxHeight = NULL
)
htmlFragment |
an HTML fragment |
pdfFile |
the pdf file |
css |
a list of valid css style specifications (not urls to stylesheets) |
chromeBinary |
the chrome browser (or chromium) path |
maxWidth |
the maximum width of the output in inches |
maxHeight |
the maximum height of the output in inches |
the pdf path
try({
hux = iris %>% huxtable::as_hux() %>% huxtable::theme_mondrian(font="Roboto")
html = hux %>% huxtable::to_html()
tmp = .print_html_with_chrome(html,maxWidth = 5,maxHeight = std_size$A4$height)
# browseURL(tmp)
# The resulting pdf has fonts embedded & is multipage.
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.