如何解决导出ppt的flextable行中未显示图像
我正在尝试导出一张柔性表,使其上面带有图片行,但不显示在生成的PowerPoint上,以将其导出到Powerpoint。
您是否知道问题出在哪里?
预先感谢
library(kableExtra)
library(flextable)
library(officer)
doc <- read_pptx()
img.file <- file.path( R.home("doc"),"html","logo.jpg" )
myft <- flextable( head(mtcars),col_keys = c("am","separator","gear","mpg","drat","qsec" ))
myft <- compose( myft,i = ~ qsec > 18,j = "qsec",value = as_paragraph(as_image( src = img.file,width = .20,height = .15))
)
myft <- autofit(myft)
myft
doc <- add_slide(doc)
doc <- ph_with(doc,value = myft,location = ph_location_template(top = 2,width = 4,type = "body"))
print(doc,target = "./cars.pptx")
system2('cmd',args = c('/c','"./cars.pptx"'))
解决方法
PowerPoint无法做到这一点,您可以在此处阅读文档:https://davidgohel.github.io/flextable/articles/display.html#limitation-for-powerpoint-1
当输出格式为PowerPoint时,不支持在flextable中使用图像。这不是选择,也不是未实现的功能。这是因为PowerPoint无法将图像嵌入表格单元格中。这是PowerPoint的限制。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。