powered by
dev.off.pdf() is a wrapper of dev.off() which is meant for closing a pdf device. It also performs cropping and font embedding if chosen.
dev.off.pdf()
dev.off()
dev.off.pdf(file="Rplots.pdf", crop=NULL, embedFonts="", ...)
invisible().
invisible()
output file name including extension .pdf.
cropping command, can be one of:
NULL
crop with the command "pdfcrop --pdftexcmd pdftex file file 1>/dev/null 2>&1". This is suitable for Unix; for non-Unix, no cropping is done.
"pdfcrop --pdftexcmd pdftex file file 1>/dev/null 2>&1"
character
a string containing the crop command.
do not crop.
font embedding command, can be one of:
embed fonts with the command embedFonts(file, options="-dSubsetFonts=true -dEmbedAllFonts=true -dPDFSETTINGS=/printer -dUseCIEColor"). This is suitable for Unix; for non-Unix, no font embedding is done.
embedFonts(file, options="-dSubsetFonts=true -dEmbedAllFonts=true -dPDFSETTINGS=/printer -dUseCIEColor")
a string containing a font embedding command.
do not embed fonts.
additional arguments passed to dev.off().
Marius Hofert
dev.off() for closing a device, embedFonts() for font embedding. sfsmisc's pdf.end() for another approach.
embedFonts()
pdf.end()
## typical usage doPDF <- !dev.interactive(orNone=TRUE) if(doPDF) pdf(file=(file <- "crop_device.pdf"), width=6, height=6) plot(1) if(doPDF) dev.off.pdf(file) if(file.exists(file)) file.remove(file)
Run the code above in your browser using DataLab