decapitated icon indicating copy to clipboard operation
decapitated copied to clipboard

On windows, pdf file is not moved when using `chrome_dump_pdf`

Open cderv opened this issue 7 years ago • 1 comments

Following the fix in #7, I tried again to print pdf but the pdf file is not generated in the correct folder.

Currently, it is generated in dirname(chome_bin). All the part about renaming and moving does not work. Also, the return path string is not correct.

It seems that the path to the output file is missing and we should have --print-to-pdf=<output_path>. It should generate the file correctly in the destination folder, and we do not need the renaming anymore.

I'll do a PR about that.

cderv avatar Nov 11 '18 20:11 cderv

A quick fix for me is replacing https://github.com/hrbrmstr/decapitated/blob/842cc7244cff150d6ca79fcd5fc0df67e4f3d74e/R/chrome-pdf.r#L97 by

file.copy(file.path(dirname(chrome_bin), "output.pdf"), out_fil, overwrite = overwrite)

However, I assume this function worked as is for you ? Is it an issue only on windows ?

I'll work on a cleaner solution with --print-to-pdf=<output_path>.

cderv avatar Nov 11 '18 21:11 cderv