Modifier and Type | Field and Description |
---|---|
Clip |
clip
An object which specifies clipping of the resulting image.
|
Boolean |
fullPage
When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport.
|
Boolean |
omitBackground
Hides default white background and allows capturing screenshots with transparency.
|
Path |
path
The file path to save the image to.
|
Integer |
quality
The quality of the image, between 0-100.
|
Double |
timeout
Maximum time in milliseconds, defaults to 30 seconds, pass
0 to disable timeout. |
ScreenshotType |
type
Specify screenshot type, defaults to
png . |
Constructor and Description |
---|
ScreenshotOptions() |
Modifier and Type | Method and Description |
---|---|
Page.ScreenshotOptions |
setClip(Clip clip) |
Page.ScreenshotOptions |
setClip(double x,
double y,
double width,
double height) |
Page.ScreenshotOptions |
setFullPage(boolean fullPage) |
Page.ScreenshotOptions |
setOmitBackground(boolean omitBackground) |
Page.ScreenshotOptions |
setPath(Path path) |
Page.ScreenshotOptions |
setQuality(int quality) |
Page.ScreenshotOptions |
setTimeout(double timeout) |
Page.ScreenshotOptions |
setType(ScreenshotType type) |
public Clip clip
public Boolean fullPage
false
.public Boolean omitBackground
jpeg
images.
Defaults to false
.public Path path
path
is a relative
path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to
the disk.public Integer quality
png
images.public Double timeout
0
to disable timeout. The default value can be changed by
using the BrowserContext.setDefaultTimeout()
or Page.setDefaultTimeout()
methods.public ScreenshotType type
png
.public Page.ScreenshotOptions setClip(double x, double y, double width, double height)
public Page.ScreenshotOptions setClip(Clip clip)
public Page.ScreenshotOptions setFullPage(boolean fullPage)
public Page.ScreenshotOptions setOmitBackground(boolean omitBackground)
public Page.ScreenshotOptions setPath(Path path)
public Page.ScreenshotOptions setQuality(int quality)
public Page.ScreenshotOptions setTimeout(double timeout)
public Page.ScreenshotOptions setType(ScreenshotType type)
Copyright © 2021. All rights reserved.