PDF_crop | R Documentation |
PDF_crop()
removes ("crops") the white margins around a PDF. It
requires that pdfcrop.exe be installed and in your path. To get pdfcrop.exe,
install MikTeX or Tex Live, or just use tinytex::tlmgr_install('pdfcrop')
.
PDF_crop( input, dirOutput = NULL, outputExtension = "_crop", deleteOriginal = TRUE, openCropped = FALSE, verbose = FALSE )
input |
A string. Path and name of file to be cropped. If |
dirOutput |
A string. Path of directory into which cropped file should be placed. |
outputExtension |
A string. The new file will have the same name as
the old file, except that |
deleteOriginal |
Logical, defaulting to |
openCropped |
Logical, defaulting to |
verbose |
Logical, defaulting to |
knitr::plot_crop()
, which is less
flexible in its handling of PDF files but can handle other file formats.
## Not run: tmpFile <- tempfile(fileext = ".pdf") pdf(tmpFile) plot(1:10, 1:10) dev.off() PDF_crop(tmpFile) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.