pdf2png | R Documentation |
The function makes a system call to convert PDF files to high-quality (300 dpi) PNG files.
pdf2png(
...,
convert = "convert",
density = 300,
outdir = NULL,
outfile = NULL,
wait = FALSE
)
... |
PDF files |
convert |
Name of the convert program. It is overwritten if the program is running on the udis machine (rbaus024). See the code for more details. |
density |
DPI. Default 300 is good enough for publications in most biology/medicine journals |
outdir |
Output directory. If the value is |
outfile |
Output file names. If the value is |
wait |
Logical, should the function wait until the conversion is finished? |
Output file names are returned invisibly.
Jitao David Zhang <jitao_david.zhang@roche.com>
tmpdir <- tempdir()
pdffile <- file.path(tmpdir, "test-plot.pdf")
pdf(pdffile)
plot(1:5)
dev.off()
pdf2png(pdffile)
pdf2png(pdffile, outfile="test.png")
testfile <- system.file("/doc/intro.pdf", package="limma")
if(file.exists(testfile)) {
pdf2png(testfile, outdir=tmpdir)
Sys.sleep(1)
dir(tmpdir)
## or waiting
pdf2png(testfile, outdir=tmpdir, wait=TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.