Skip to content

Conversation

@kgf1980
Copy link

@kgf1980 kgf1980 commented May 2, 2024

I've created a PR which exposes the "fromSurface" screenshot option, as well as adding the ability to specify the viewport to use when creating a screenshot - when requesting a specific viewport size you also need to set fullPage to false (perhaps this should automatically happen if viewport options are provided?)

Example usage:

curl --location 'http://localhost:2305/1/screenshot' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://news.ycombinator.com",
    "export": {
        "type": "png",
        "fullPage": false,
        "fromSurface": false,
        "viewport": {
            "width": 800,
            "height": 480
        }
    }
}' \
--output test.png

…ing a screenshot using the Puppeteer Page.setVIewport() method
Spacetown added a commit to Spacetown/gcovr that referenced this pull request Dec 13, 2025
For correct screenshot we need to set the viewport. The PR
bedrockio/export-html#8 for the container is
still not merged, therefore we do the patch before building it.
Spacetown added a commit to Spacetown/gcovr that referenced this pull request Dec 13, 2025
For correct screenshot we need to set the viewport. The PR
bedrockio/export-html#8 for the container is
still not merged, therefore we do the patch before building it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant