Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple external_img() pptx creation works but powerpoint reports 'problem with content' #613

Open
schalkwyk opened this issue Sep 30, 2024 · 6 comments

Comments

@schalkwyk
Copy link

I'm making a pptx version of beamer slides, where I have sliced up the beamer pdf with gs.
The code below works and would of course be easy to loop over all slides. Powerpoint says "PowerPoint found a problem with content in pr.pptx.
PowerPoint can attempt to repair the presentation.

If you trust the source of this presentation, click Repair."

and then displays the slides correctly.

(Microsoft Powerpoint for Mac v 16.83)

pr <- read_pptx()
pr <- add_slide(pr, layout = "Blank", master = "Office Theme")
pr <- ph_with(x=pr, external_img('leo_shared/talks/Leo/2024/miRNA/slides/slide1.pdf'),

  • location = ph_location_fullsize() )

pr <- add_slide(pr, layout = "Blank", master = "Office Theme")
pr <- ph_with(x=pr, external_img('leo_shared/talks/Leo/2024/miRNA/slides/slide2.pdf'),

  • location = ph_location_fullsize() )

pr <- add_slide(pr, layout = "Blank", master = "Office Theme")
pr <- ph_with(x=pr, external_img('leo_shared/talks/Leo/2024/miRNA/slides/slide3.pdf'),

  • location = ph_location_fullsize() )

print(pr, target='pr.pptx')

sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin21.6.0
Running under: macOS Monterey 12.1

Matrix products: default
BLAS: /opt/homebrew/Cellar/openblas/0.3.27/lib/libopenblasp-r0.3.27.dylib
LAPACK: /opt/homebrew/Cellar/r/4.4.0/lib/R/lib/libRlapack.dylib; LAPACK version 3.12.0

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

time zone: Europe/London
tzcode source: internal

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

other attached packages:
[1] officer_0.6.6

loaded via a namespace (and not attached):
[1] compiler_4.4.0 R6_2.5.1 cli_3.6.3 ragg_1.3.2
[5] tools_4.4.0 uuid_1.2-1 xml2_1.3.6 zip_2.3.1
[9] textshaping_0.4.0 lifecycle_1.0.4 rlang_1.1.4 systemfonts_1.1.0
[13] openssl_2.2.0 askpass_1.2.0

@markheckmann
Copy link
Contributor

Can you please provide a fully reproducible example, i.e. including the PDF files?

@schalkwyk
Copy link
Author

schalkwyk commented Sep 30, 2024 via email

@markheckmann
Copy link
Contributor

I cannot find an attachment in the reply you sent via email. Could you please check directly on GitHub?

@schalkwyk
Copy link
Author

@markheckmann
Copy link
Contributor

I don't think that officer can handle PDF files as image input. However, I cannot find any suffix checks that prevent this.
I guess, the easiest fix would be to convert the PDFs to JPEG or PNG before adding them.

@schalkwyk
Copy link
Author

schalkwyk commented Sep 30, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants