Comments (5)
Can you make a reproducible example and the sessionInfo()?
from officer.
Here's a simple example. The footer of every slide in the slideshow "myoutput2.pptx" should be a link back to slide #2; instead they all link to slide #10.
#====Create presentation using ReporteRs
template_path<-"mytemplate.pptx"
output_path1<-"myoutput1.pptx"
today <- Sys.Date()
mydoc <- pptx(template=template_path)
slide.layouts(mydoc)
mydoc = addSlide(mydoc, "Title Slide" ) #pick the slide format from the template parameter
mytitle<-paste("Main Title")
for (i in 1:20){
mydoc = addSlide(mydoc, "Title and Content" ) #pick the slide format from the template parameter
mydoc = addTitle(mydoc, paste("Title", i))
slidetext = c( "test")
mydoc <-addParagraph( mydoc, value = slidetext )
mydoc = addPageNumber( mydoc )
mydoc = addFooter( mydoc, today)
}
writeDoc( mydoc, output_path1 )
#====Add internal links using officeR
doc <- read_pptx(output_path1)
doc_nslides<-length(doc)
for(i in 3:doc_nslides){
doc <- on_slide(doc, index=i)
doc <- ph_slidelink(doc, type = "ftr", slide_index = 2)#takes user to slide #2
}
print(doc, target = "myoutput1.pptx")
And here is the session info:
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.5 (unknown)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] VennDiagram_1.6.17 GGally_1.3.0 stringr_1.0.0 scales_0.4.1 gridExtra_2.0.0 xtable_1.8-0 gplots_2.17.0 raster_2.4-18 sp_1.1-1
[10] png_0.1-7 ReporteRs_0.8.2 ReporteRsjars_0.0.2 extrafont_0.17 qqman_0.1.2 futile.logger_1.4.1 progress_1.0.2 officer_0.1.1 plotly_4.5.6
[19] ggplot2_2.2.0 rJava_0.9-7
loaded via a namespace (and not attached):
[1] gtools_3.5.0 purrr_0.2.2 reshape2_1.4.1 lattice_0.20-31 colorspace_1.2-6 htmltools_0.3.5 viridisLite_0.1.3 yaml_2.1.13
[9] base64enc_0.1-3 R.oo_1.21.0 DBI_0.3.1 R.utils_2.5.0 gdtools_0.1.4 RColorBrewer_1.1-2 lambda.r_1.1.7 plyr_1.8.3
[17] munsell_0.4.2 gtable_0.2.0 R.methodsS3_1.7.1 htmlwidgets_0.8 caTools_1.17.1 labeling_0.3 parallel_3.2.1 Rttf2pt1_1.3.3
[25] Rcpp_0.12.10 KernSmooth_2.23-14 gdata_2.17.0 jsonlite_1.1 digest_0.6.8 stringi_0.5-5 dplyr_0.4.3 tools_3.2.1
[33] bitops_1.0-6 magrittr_1.5 lazyeval_0.2.0 tibble_1.2 futile.options_1.0.0 extrafontdb_1.0 tidyr_0.6.0 xml2_1.1.1
[41] prettyunits_1.0.2 assertthat_0.1 reshape_0.8.5 httr_1.2.1 R6_2.1.2
from officer.
That's because you're working with an old version, update the package from CRAN and things will be ok
from officer.
updating to the new version 0.1.3 seems to have resolved this issue. Thanks!
from officer.
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)
- Installation fails: Error in parse(outFile) : {INSTALL_DIR}/officer/R/docx_comments.R:52:44: unexpected input
- Read_docx does not respect embedded fonts HOT 3
- Saving pptx files fails if officer is installed read-only HOT 5
- `ph_with.gg` does not add an `alt_text=` to pptx HOT 1
- body_add_docx workaround for fast generation of large documents doesn't work anymore HOT 2
- It is hoped that `block_pour_docx()` can work in bookdown::word_document2 HOT 4
- how to add hyperlink for embedded image in PPT. HOT 1
- remove_slide doesn't remove images from ppt/media HOT 4
- Add comment to an existing paragraph HOT 3
- Add fixed = TRUE argument to cursor_reach HOT 1
- body_add_docx() doesn't work if file path for src contains " " (space in the filename) HOT 3
- docx_summary removes hyphens from text HOT 1
- cursor_reach_index function
- Display proper slide width and height in plot_layout_properties(), add layout title HOT 1
- Allow metric units in page_size HOT 1
- Cursor unable to advance even though there are still more elements HOT 1
- cursor_bookmark does not find bookmarks returned by docx_bookmarks HOT 4
- Citation in R using 'citation("officer")' should probably not include '_' symbols HOT 4
- body_add_img with svg files HOT 1
- External docx file target path
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from officer.