puppeteer/website/versioned_docs/version-22.8.1/api/puppeteer.screenshotoptions.md
release-please[bot] 042d61030c
chore: release main (#12415)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2024-05-13 08:49:32 +00:00

2.3 KiB

sidebar_label
ScreenshotOptions

ScreenshotOptions interface

Signature:

export interface ScreenshotOptions

Properties

Property

Modifiers

Type

Description

Default

captureBeyondViewport

optional

boolean

Capture the screenshot beyond the viewport.

false if there is no clip. true otherwise.

clip

optional

ScreenshotClip

Specifies the region of the page/element to clip.

encoding

optional

'base64' | 'binary'

Encoding of the image.

'binary'

fromSurface

optional

boolean

Capture the screenshot from the surface, rather than the view.

true

fullPage

optional

boolean

When true, takes a screenshot of the full page.

false

omitBackground

optional

boolean

Hides default white background and allows capturing screenshots with transparency.

false

optimizeForSpeed

optional

boolean

false

path

optional

string

The file path to save the image to. The screenshot type will be inferred from file extension. If path is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.

quality

optional

number

Quality of the image, between 0-100. Not applicable to png images.

type

optional

'png' | 'jpeg' | 'webp'

'png'