Is there a simplified way to add background image to all slide using appscript.

118 views
Skip to first unread message

Rakesh Raju

unread,
Aug 22, 2023, 10:41:02 AM8/22/23
to Google Apps Script Community
const slideFile = SlidesApp.openById(bookFile.getId());
let slides = slideFile.getSlides();
slides.forEach(slide => {
    slide.getBackground().setPictureFill(blobdata);
  });

cwl...@gmail.com

unread,
Sep 2, 2023, 10:40:42 PM9/2/23
to Google Apps Script Community
Try this:
function myFunction() {
  var slidesBackground = SlidesApp.getActivePresentation().getMasters()[0].getBackground()
  slidesBackground.setPictureFill(bgdImg)
}

so this should work:
const slideFile = SlidesApp.openById(bookFile.getId());
slideFile.getMasters()[0].getBackground().setPictureFill( blobdata  )

Rakesh Raju

unread,
Sep 5, 2023, 4:12:19 AM9/5/23
to Google Apps Script Community
Thanks bro. That worked.
Reply all
Reply to author
Forward
0 new messages