Resize image imported by magick::image_read_pdf in xaringan presentation

33 views Asked by At

I have a slide in my xaringan presentation that displays an image imported from a pdf using image_read_pdf. My code is the following:

library(pdftools)
magick::image_read_pdf("plots/plot.pdf",
                       pages = 1)

Unfortunately, the image is far too large, and extends well off the slide. How can I resize this? I have tried using the out.width and out.height arguments of the knitr, but nothing changes. There is no argument in the image_read_pdf function, so is there another function I can apply to this to resize the image?

0

There are 0 answers