4

I've been poking around in the Google Slides API documentation. I can only find a way to update the element sizes. What I want to do is update the page setup size to widescreen 16:10.

I looked at this documentation and this but this just references page elements, not the slide its self. Is there any preferred or suggested way to go about doing this?

Joshua Jones
  • 109
  • 9

2 Answers2

4

Those are links to the Google Apps Script Slides Service documentation (known as a built-in service). It gives you access to some features of the Google Slides API but not all. What you need is the advanced slides service, which is a direct analog of the Google Slides API. To use them effectively read the Advanced Google Services guide for more information.

You can set the page size of a presentation when its created using the Advanced Service (see reference documentation). However your presentation may be letter-boxed (top and bottom padded with black boxes) if your presentations have a high width-to-height ratio.

TheAddonDepot
  • 8,408
  • 2
  • 20
  • 30
  • What happens if the slide has already been created and you only want to update it? – Joshua Jones Jan 02 '19 at 17:01
  • I see! It returns a new slide. Thanks :) – Joshua Jones Jan 02 '19 at 17:35
  • Do you think you could show me an example? I'm still not able to update the sizes of every presentation I have. I've tried looping over every ID Slides.Presentations.create(REQUEST, slidesId[i]); but this does nothing. – Joshua Jones Jan 04 '19 at 18:41
  • Based on what I've seen in the documentation you can only set the dimensions of a presentation when its created. There doesn't seem to be a way to change/update the dimensions of a pre-existing presentation. – TheAddonDepot Jan 04 '19 at 20:15
  • 1
    You actually cannot set the size using that create API. "If a presentationId is provided, it is used as the ID of the new presentation. Otherwise, a new ID is generated. Other fields in the request, including any provided content, are ignored." It actually ignores the `size` field. – Dustin Kane Jun 29 '20 at 16:41
3

There is a workaround for that issue. Create a template presentation, modify it and then copy it using Google Drive API. See more details here https://stackoverflow.com/a/41678345/2987759

Sergei V Kim
  • 205
  • 1
  • 2
  • 7
  • This is a link to the Slides API bug. If more people star it, maybe it will get fixed instead of requiring workaround: issuetracker.google.com/issues/74602138 – d35348w May 26 at 16:05 – aNewb Aug 17 '21 at 14:17