dot-print_html_with_chrome: Print a HTML fragment using chrome

.print_html_with_chromeR Documentation

Print a HTML fragment using chrome

Description

Print a HTML fragment using chrome

Usage

.print_html_with_chrome(
  htmlFragment,
  pdfFile = tempfile(fileext = ".pdf"),
  css = list(),
  chromeBinary = getOption("ggrrr.chrome", default = .find_chrome()),
  maxWidth = NULL,
  maxHeight = NULL
)

Arguments

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

Value

the pdf path

Examples

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.
})

terminological/ggrrr documentation built on June 15, 2024, 6:35 a.m.