pdftools icon indicating copy to clipboard operation
pdftools copied to clipboard

Add `path` argument to `pdf_convert()`

Open dmi3kno opened this issue 4 years ago • 3 comments

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")

dmi3kno avatar Dec 29 '19 19:12 dmi3kno

Replicated.

jzadra avatar May 20 '20 21:05 jzadra

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.

jzadra avatar May 20 '20 21:05 jzadra

how do I get the output file name equal to the input file name...what should be filename formatting for that

prishak avatar Jul 17 '20 11:07 prishak