I am currently creating a google doc that provides an overview of all the slides in a presentation using App Scripts. At the moment for each slide I create a thumbnail image and add that to the google doc.
What would be better is an embed of the slide in the doc (so that things such as animations etc show up in the Google doc) - this would be similar to hitting copy on a slide and then paste in Google docs.
Would anyone know how this can be achieved using App Scripts?
For reference this is the function I made for the thumbnails:
// Gets thumbnail URL
function getThumbnail(presentation, slideId) {
var presentationId = presentation.getId()
var baseUrl = "https://slides.googleapis.com/v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail?thumbnailProperties.thumbnailSize=SMALL"
var url = baseUrl
.replace("{presentationId}", presentationId)
.replace("{pageObjectId}", slideId);
var parameters = {
method: "GET",
headers: { Authorization: "Bearer " + ScriptToken },
contentType: "application/json",
muteHttpExceptions: true
};
var response = JSON.parse(UrlFetchApp.fetch(url, parameters));
return response.contentUrl
}
// Update Thumbnails in Doc
function updateThumbnailCell(row, contentUrl) {
var thumbnailCell = row.getCell(THUMBNAIL_DOC_COLUMN)
thumbnailCell.clear()
var imageBlob = UrlFetchApp.fetch(contentUrl).getBlob()
thumbnailCell.insertImage(0, imageBlob).setWidth(200);
}
Cheers,
Shadi