hrbrmstr / decapitated

Headless 'Chrome' Orchestration in R
Other
65 stars 3 forks source link

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

Open cderv opened 5 years ago

cderv commented 5 years ago

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 commented 5 years ago

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>.