1

With the Slides API getThumbnail it is possible to generate a thumbnail of a specific slide/page (pageObjectId) of a specific presentation (presentationId):

GET https://slides.googleapis.com/v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail

I am wondering if it is possible to get a thumbnail of a specific object, for example a shape (not the whole slide/page). I know the ObjectId and of course the pageObjectId and presentationId.

Thank you!

1 Answer 1

1

It is not possible to obtain the thumbnail of a specific object using that method because you are going to get the following error if you use the object ID of something that is not a page:

The specified object with pageObjectId "your object ID" is not a page.

A possible workaround would be to create an additional blank page within the same document or in a new one, then copy the shape to it, and change the shape size to cover the whole page, and then delete it, that way when you get the thumbnail of the page you will only see the exact same shape you created.

In case you want to do it for images, you can "create" your own thumbnail by using the presentations.pages.get and modify the size parameter of the contentUrl from the response.

An example of the contentUrl would be this one. If you check the URL you will see that the size parameter can be found at the end like s=2048, however you can modify that number to get the size you prefer, for example this one, I only changed the parameter to s=250.

Just note that the default lifetime of that URL is 30 minutes and would only work for images, not for shapes.

References:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.