officer
officer copied to clipboard
Saving pptx files fails if officer is installed read-only
If officer is installed read-only, saving pptx files fails. This is in reference to the issue stated here #549 which fixed for docx but fails for pptx.
library(officer)
my_pres <- read_pptx()
my_pres <- add_slide(my_pres, layout = "Title and Content", master = "Office Theme")
print(my_pres, target = 'test.pptx')
> print(my_pres, target = 'test.pptx')
Error in write_xml.xml_document(private$doc, file = private$filename) :
Error closing file
In addition: Warning messages:
1: In write_xml.xml_document(private$doc, file = private$filename) :
Permission denie [1501]
2: In write_xml.xml_document(private$doc, file = private$filename) :
Permission denie [1501]
ha, ok
I will try to fix soon
@davidgohel following up on the issue. Is there anything required from our end that can help?
Encountered the same issue. This one is important to me too. Thank you!
I am not able to reproduce.
It works with the github commit that was supposed to fix it:
nix-shell -p R -p '(rPackages.officer.overrideAttrs (_: {src = (fetchTarball "https://github.com/davidgohel/officer/archive/dbb27faa10e6a520092716748992d69271bf3c94.tar.gz");}))' --run 'Rscript -e "library(officer); d <- read_pptx(); d <- add_slide(d); print(d, target = \"~/test.pptx\")"'
It also works with the cran version:
nix-shell -p R -p rPackages.officer --run 'Rscript -e "library(officer); d <- read_pptx(); d <- add_slide(d); print(d, target = \"~/test.pptx\")"'
How can I reproduce your issue?
@natashanath @nviets could you provide something that helps me to reproduce?