当我在一张幻灯片上放置超过九个对象时,最新的对象默认为垂直(文本会发生这种情况,不确定图或图像)。我的公司确实有在幻灯片上放太多信息的习惯,但如果可能的话,他们希望保持相同的格式。我不确定 ReporteRs 包是否有设置最大对象数的选项,或者这可能是运行包的依赖项之一的问题。我将附上屏幕截图和代码。我创建了一个名为 Presentation1.pptx 的空白文档并将其放在我的工作目录中。
代码:
library("ReporteRs")
pres <- pptx(template = "Presentation1.pptx")
pres <- addSlide(pres, slide.layout = 'Blank')
pres <- addParagraph(par.properties = parProperties(),
doc = pres, text.align = "left", value = pot("SOME TEXT",
textBold(color = "black", font.size = 36, font.family = "Arial")),
offx = 0.5, offy = 0, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 1),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 21, font.family = "Arial")),
offx = 0.25, offy = 1, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 1.5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 2, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 1),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 21, font.family = "Arial")),
offx = 0.25, offy = 2.5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 3, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 3.5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 4, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 4.5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Copyright Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 3, offy = 7, width = 0, height = 1)
writeDoc(pres, file = "pres.pptx")