Skip to content

ScreenshotOptions

Namespace: PuppeteerSharp

public class ScreenshotOptions

Options to be used in ScreenshotOptions), ScreenshotStreamAsync(ScreenshotOptions) and ScreenshotDataAsync(ScreenshotOptions).

Inheritance: object

Derived: ElementScreenshotOptions

View source

[JsonIgnore]
public bool BurstMode { get; set; }

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.

Value: bool

Example

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();

View source

public bool CaptureBeyondViewport { get; set; }

Capture the screenshot beyond the viewport.

Value: bool

View source

public Clip Clip { get; set; }

Specifies clipping region of the page/element.

Value: Clip — The clip.

View source

public bool? FromSurface { get; set; }

Capture the screenshot from the surface, rather than the view. Defaults to true.

Value: bool?

View source

public bool FullPage { get; set; }

When true, takes a screenshot of the full scrollable page. Defaults to false.

Value: bool — true if full page; otherwise, false.

View source

public bool OmitBackground { get; set; }

Hides default white background and allows capturing screenshots with transparency. Defaults to false.

Value: bool — true if omit background; otherwise, false.

View source

public bool? OptimizeForSpeed { get; set; }

Optimize image encoding for speed.

Value: bool?

View source

public int? Quality { get; set; }

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

Value: int? — The quality.

View source

public ScreenshotType? Type { get; set; }

Specify screenshot type, can be either jpeg, png or webp. Defaults to ‘png’.

Value: ScreenshotType? — The type.

View source

Made with love by Dario Kondratiuk