Git Product home page Git Product logo

Comments (8)

davidgohel avatar davidgohel commented on May 30, 2024

Hi,

I can't reproduce. Send your sessionInfo and a reproducible code.

Thanks

from officer.

imamanatee avatar imamanatee commented on May 30, 2024

`sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_South Africa.1252 LC_CTYPE=English_South Africa.1252 LC_MONETARY=English_South Africa.1252
[4] LC_NUMERIC=C LC_TIME=English_South Africa.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] bindrcpp_0.2 flextable_0.2.0 officer_0.1.5 stringr_1.2.0 extrafont_0.17 ggplot2_2.2.1 RPostgreSQL_0.6-2
[8] DBI_0.7

loaded via a namespace (and not attached):
[1] zip_1.0.0 Rcpp_0.12.12 compiler_3.4.1 plyr_1.8.4 bindr_0.1 R.methodsS3_1.7.1 R.utils_2.5.0
[8] base64enc_0.1-3 tools_3.4.1 digest_0.6.12 uuid_0.1-2 tibble_1.3.3 gtable_0.2.0 pkgconfig_2.0.1
[15] rlang_0.1.2 Rttf2pt1_1.3.4 dplyr_0.7.2 xml2_1.1.1 htmlwidgets_0.9 gdtools_0.1.5 grid_3.4.1
[22] glue_1.1.1 R6_2.2.2 tidyr_0.6.3 purrr_0.2.3 extrafontdb_1.0 magrittr_1.5 scales_0.4.1
[29] htmltools_0.3.6 assertthat_0.2.0 colorspace_1.3-2 stringi_1.1.5 lazyeval_0.2.0 munsell_0.4.3 R.oo_1.21.0

`

my_pres <- read_pptx(path = paste(path,"Bundle Analysis.pptx",sep="",collapse=""))
my_pres <- add_slide(my_pres, "Presentation Title Slide","Digitata DT PPT template 16x9 - 2016")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")


Bundle Analysis.pptx

In the first line, replace path with the location where you save the attached file

from officer.

davidgohel avatar davidgohel commented on May 30, 2024

The following code is producing the following 10 slides doc:

library(officer)

my_pres <- read_pptx(path = "Bundle.Analysis.pptx")
my_pres <- add_slide(my_pres, "Presentation Title Slide","Digitata DT PPT template 16x9 - 2016")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")


print(my_pres, target = "toto.pptx")

toto.pptx

Here is my sessionInfo():

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] officer_0.1.5

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.12       xml2_1.1.1         bindr_0.1          magrittr_1.5      
 [5] uuid_0.1-2         munsell_0.4.3      colorspace_1.3-2   R6_2.2.2          
 [9] rlang_0.1.2        plyr_1.8.4         dplyr_0.7.2        tools_3.4.1       
[13] grid_3.4.1         gtable_0.2.0       R.oo_1.21.0        htmltools_0.3.6   
[17] yaml_2.1.14        lazyeval_0.2.0     digest_0.6.12      assertthat_0.2.0  
[21] tibble_1.3.3       zip_1.0.0          bindrcpp_0.2       purrr_0.2.3       
[25] ggplot2_2.2.1.9000 base64enc_0.1-3    R.utils_2.5.0      glue_1.1.1        
[29] compiler_3.4.1     gdtools_0.1.5      scales_0.4.1.9002  R.methodsS3_1.7.1 
[33] pkgconfig_2.0.1   

from officer.

imamanatee avatar imamanatee commented on May 30, 2024

Okay, sorry about that. Must be a problem on my side. Thanks for the help.

from officer.

imamanatee avatar imamanatee commented on May 30, 2024

Just as a follow up, I discovered how to fix it. For each slide I was adding a title and it was objecting after slide 9. So then I just changed the on_slide index to 9 for all the slides after 9 and it worked. Seems like a hack work around but just thought I'd let you know.


my_pres <- read_pptx(path = "Bundle Analysis.pptx")
my_pres <- add_slide(my_pres, "Presentation Title Slide","Digitata DT PPT template 16x9 - 2016")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- on_slide(my_pres,index = 9)
my_pres <- ph_with_text(my_pres,type = "title", str = "Index = 9") 
my_pres <- ph_empty_at(x = my_pres,left=0.1,top=0.5,height = 1, width = 2)
my_pres <- ph_add_par(my_pres,id=3)
my_pres <- add_slide(my_pres, "Custom Layout","2_Digitata PPT Template")
my_pres <- on_slide(my_pres,index = 9)
my_pres <- ph_with_text(my_pres,type = "title", str = "Index = 9 again") 
my_pres <- ph_empty_at(x = my_pres,left=0.1,top=0.5,height = 1, width = 2)
my_pres <- ph_add_par(my_pres,id=3)

print(my_pres, target = "toto.pptx")

from officer.

davidgohel avatar davidgohel commented on May 30, 2024

Thanks, I can see the issue now

from officer.

davidgohel avatar davidgohel commented on May 30, 2024

It should be ok now with the github version

from officer.

github-actions avatar github-actions commented on May 30, 2024

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

from officer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.