'How to render a Google Slides presentation via API
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
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?
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vescoci |
