to_png | R Documentation |
Render PNG image(s) of slides. The function renders to the PDF and
then converts it into PNG files of each slide. The slide numbers defined by
the slides
argument are saved (defaults to 1
, returning only the title
slide). If length(slides) > 1
, it will return the PNG files in a ZIP file.
You can also get a ZIP file of all the slides as PNGs by setting slides = "all"
).
to_png( from, to = NULL, density = 100, slides = 1, complex_slides = FALSE, partial_slides = FALSE, delay = 1, keep_intermediates = FALSE )
from |
Path to an |
to |
Name of the output |
density |
Resolution of the resulting PNGs in each slide file. Defaults
to |
slides |
A numeric or integer vector of the slide number(s) to render
as PNG files , or one of |
complex_slides |
For "complex" slides (e.g. slides with panelsets or
other html widgets or advanced features), set |
partial_slides |
Should partial (continuation) slides be included in the
output? If |
delay |
Seconds of delay between advancing to and printing a new slide.
Only used if |
keep_intermediates |
Should we keep the intermediate files used to
render the final output? The default is |
Slides are rendered as a .png
file (single) or .zip
file of
multiple .png
files.
with_example("slides.Rmd", requires_chrome = TRUE, { # By default a png of only the first slide is built to_png("slides.Rmd", keep_intermediates = TRUE) # or render a zip file of multiple or all slides (`slides = "all"`) to_png("slides.pdf", slides = c(1, 3, 5)) })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.