Tenex
Tenex2mo ago

Wes (Tenex Labs) - I've been looking all over. ...

I've been looking all over. Is there no way to adjust the viewport size with the puppeteer screenshots?
6 Replies
Gaurav Chadha
Gaurav Chadha2mo ago
Hi @Wes, you can use clip in the options with viewport size and dimensions, you can refer to these available puppeteer options - https://pptr.dev/api/puppeteer.screenshotoptions.
No description
Tenex
Tenex2mo ago
Clip just crops it no? I want a full page screenshot of desktop size, unlike this current output: https://storage.googleapis.com/buildship-3bbhxt-us-east1/2ac9f490-ea6f-46d2-b2ae-9b9a39a87d65.png
Gaurav Chadha
Gaurav Chadha2mo ago
You can refer to this for specifying viewport for device specific - https://pptr.dev/api/puppeteer.viewport The clip suggested before helps to get screenshot for any dimensions. Also, you can leverage the autofill with ai specifying the viewport for puppeteer.
No description
Tenex
Tenex2mo ago
I used the exact same settings, they don't change the puppeteer output at all. Are you sure the screenshot element has access to the viewport/page options?
No description
Gaurav Chadha
Gaurav Chadha2mo ago
Hey @Wes, the above screenshot was an example, you can check the link for setting viewport, cc @Luis could you share an example for setting viewport.
Tenex
Tenex2mo ago
I think all I'm trying to figure out is how 'https://puppeteer.buildship.run/v1/screenshot' works since there doesn't seem to be any docs available for this endpoint. It also doesn't look like it has access to the Page object which is what ViewPort is attached to.