Class ScreenshotOptions
- Namespace
- PuppeteerSharp
- Assembly
- PuppeteerSharp.dll
Options to be used in ScreenshotAsync(string, ScreenshotOptions), ScreenshotStreamAsync(ScreenshotOptions) and ScreenshotDataAsync(ScreenshotOptions).
public class ScreenshotOptions
- Inheritance
-
ScreenshotOptions
- Derived
Properties
BurstMode
When BurstMode is true
the screenshot process will only execute all the screenshot setup actions (background and metrics overrides)
before the first screenshot call and it will ignore the reset actions after the screenshot is taken.
SetBurstModeOffAsync() needs to be called after the last screenshot is taken.
[JsonIgnore]
public bool BurstMode { get; set; }
Property Value
Examples
var screenShotOptions = new ScreenshotOptions { FullPage = true, BurstMode = true }; await page.GoToAsync("https://www.google.com"); for(var x = 0; x < 100; x++) { await page.ScreenshotBase64Async(screenShotOptions); } await page.SetBurstModeOffAsync();
CaptureBeyondViewport
Capture the screenshot beyond the viewport.
public bool CaptureBeyondViewport { get; set; }
Property Value
Clip
Specifies clipping region of the page.
public Clip Clip { get; set; }
Property Value
- Clip
The clip.
FromSurface
Capture the screenshot from the surface, rather than the view. Defaults to true
.
public bool? FromSurface { get; set; }
Property Value
- bool?
FullPage
When true
, takes a screenshot of the full scrollable page. Defaults to false
.
public bool FullPage { get; set; }
Property Value
- bool
true
if full page; otherwise,false
.
OmitBackground
Hides default white background and allows capturing screenshots with transparency. Defaults to false
.
public bool OmitBackground { get; set; }
Property Value
- bool
true
if omit background; otherwise,false
.
OptimizeForSpeed
Optimize image encoding for speed.
public bool? OptimizeForSpeed { get; set; }
Property Value
- bool?
Quality
The quality of the image, between 0-100. Not applicable to png images.
public int? Quality { get; set; }
Property Value
- int?
The quality.
Type
Specify screenshot type, can be either jpeg, png or webp. Defaults to 'png'.
public ScreenshotType? Type { get; set; }
Property Value
- ScreenshotType?
The type.