pdftools
pdftools copied to clipboard
Add `path` argument to `pdf_convert()`
It does not seem to be possible to specify a path for storing converted png files after converting a PDF. This, for example, works for me:
pdf_file <- "https://github.com/dmi3kno/user19-polite/raw/master/useR19%20-%20polite.pdf"
pdftools::pdf_convert(pdf_file, dpi = 300, filenames = "page_%d.%s")
While this crashes my R session:
pdftools::pdf_convert(pdf_file, dpi = 300, filenames = "~/Documents/page_%d.%s")
I would like to be able to specify where to store the files, perhaps like this:
# do not run
pdftools::pdf_convert(pdf_file, dpi = 300, path="~/Documents/", filenames = "page_%d.%s")
Replicated.
In addition, creating a vector of paths ahead of time also causes a segfault. So it is not the page/format placeholders (which have zero documentation by the way), but rather just having a path at all.
how do I get the output file name equal to the input file name...what should be filename formatting for that