0

I'm trying to render a Google Slides presentation in my web app.

I'm using the presentations.get() method that the API provides to bring in the data from a presentation, but the way the answer comes in is unfeasible to mount on screen. Comes a giant object. a presentation of only 13 slides returns me an object with 30,000 lines.

link to example API response

image with example

If I embed it using iframe, then I can't send key/mouse events to that iframe since it's not the same origin, and I don't want to use Google's embedded control bar, since I need my own custom controls to edit slides.

Does anyone know a way to assemble the slides using the API, which allows me to edit, manipulate the slides?

  • Does this answer your question? [How to render a Google Slides presentation via API and control / move slides?](https://stackoverflow.com/questions/65707738/how-to-render-a-google-slides-presentation-via-api-and-control-move-slides) – Kos Jan 26 '22 at 21:50
  • I had already searched a lot, I entered all the topics of this post there but with no success. it's very difficult to find answers – Rômulo Carvalho Jan 26 '22 at 21:53
  • The API response comes pretty complicated to build on canvas. I'm already finding that it's not even possible to do this the way the documentation itself shows: get() – Rômulo Carvalho Jan 26 '22 at 21:57
  • There is nothing changed since - there is no API. Best you can do is download each slide as image/pdf and build on that. – Kos Jan 26 '22 at 22:05
  • In this case, how can I be sure that a certain element in the pdf will be the same in google slide? example: let's say I changed the second text that is next to an image. How am I going to map it to know that I changed this text, and update it on google slide? – Rômulo Carvalho Jan 26 '22 at 22:12
  • you'd have to independently research how to convert a pdf back to google slides – aehlke Apr 22 '22 at 14:36

1 Answers1

0

This may be a bit late for a reply but the team I'm working with has had to implement something similar.

Essentially you have the data needed to render the entire slideshow using a Google preview link like the following https://docs.google.com/presentation/d/presentationId/preview#slide=id.objectId

Replace presentationId with the id retrieved from the Google API and replace objectId with the object Ids of the slides. You can also change the url from /preview to /preview?rm=minimal to remove the slide controls if needed.

Keep in mind only Google Slides render properly so if you import any Powerpoint files, they need to be converted to the Google Slides format which can also be done through the API or on the site itself.

Slide permissions must also be setup to Anyone with Link as Viewer which again can be done through the API or on the site.

Vescoci
  • 35
  • 1
  • 1
  • 5