Skip to contents

Render slides as a PDF file. Requires a local installation of Chrome. If you set complex_slides = TRUE or partial_slides = TRUE, you will also need to install the chromote and pdftools packages.


  to = NULL,
  complex_slides = FALSE,
  partial_slides = FALSE,
  delay = 1,
  keep_intermediates = NULL



Path to an .Rmd, .qmd, .html file, or a URL. If from is a URL to slides on a website, you must provide the full URL ending in ".html".


The name of the output .pdf file. If NULL (the default) then the output filename will be based on filename for the from file. If a filename is provided, a path to the output file can also be provided.


For "complex" slides (e.g. slides with panelsets or other html widgets or advanced features), set complex_slides = TRUE. Defaults to FALSE. This will use the chromote package to iterate through the slides at a pace set by the delay argument. Requires a local installation of Chrome.


Should partial (continuation) slides be included in the output? If FALSE, the default, only the complete slide is included in the PDF.


Seconds of delay between advancing to and printing a new slide. Only used if complex_slides = TRUE or partial_slides = TRUE.


Should we keep the intermediate HTML file? Only relevant if the from file is an .Rmd file. Default is TRUE if the to file is written into the same directory as the from argument, otherwise the intermediate file isn't kept.


Slides are rendered as a .pdf file.


with_example("slides.Rmd", requires_chrome = TRUE, {
    # Render pdf from Rmd, html, or direct URL
#>  Rendering slides.Rmd into slides.html
#>  Rendering slides.Rmd into slides.html ... done
#>  Rendering slides.html into slides.pdf
#>  Rendering slides.html into slides.pdf ... done