pdf_gs() processes the pdf file with ghostscript.
This may prevent issues with other pdf processing functions like pdftools::pdf_pagesize().
Usage
pdf_gs(input, output = NULL, ..., args = character(0L))Arguments
- input
Input pdf filename.
- output
Output pdf filename.
NULLdefaults to atempfile()with a___pnpmisc.pdffile extension.- ...
Ignored.
- args
Arguments to pass to ghostscript. We automatically add
-dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sAutoRotatePages=None -sOutputFile={output}.
Examples
if (nzchar(tools::find_gs_cmd())) {
f1 <- pdf_create_blank()
f2 <- pdf_gs(f1)
unlink(f1)
unlink(f2)
}