ScreenshotOptions
Namespace: PuppeteerSharp
public class ScreenshotOptionsOptions to be used in ScreenshotOptions), ScreenshotStreamAsync(ScreenshotOptions) and ScreenshotDataAsync(ScreenshotOptions).
Inheritance: object
Derived: ElementScreenshotOptions
Properties
Section titled “Properties”BurstMode
Section titled “BurstMode”[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();
CaptureBeyondViewport
Section titled “CaptureBeyondViewport”public bool CaptureBeyondViewport { get; set; }Capture the screenshot beyond the viewport.
Value: bool
public Clip Clip { get; set; }Specifies clipping region of the page/element.
Value: Clip — The clip.
FromSurface
Section titled “FromSurface”public bool? FromSurface { get; set; }Capture the screenshot from the surface, rather than the view. Defaults to true.
Value: bool?
FullPage
Section titled “FullPage”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.
OmitBackground
Section titled “OmitBackground”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.
OptimizeForSpeed
Section titled “OptimizeForSpeed”public bool? OptimizeForSpeed { get; set; }Optimize image encoding for speed.
Value: bool?
Quality
Section titled “Quality”public int? Quality { get; set; }The quality of the image, between 0-100. Not applicable to png images.
Value: int? — The quality.
public ScreenshotType? Type { get; set; }Specify screenshot type, can be either jpeg, png or webp. Defaults to ‘png’.
Value: ScreenshotType? — The type.
Made with love by Dario Kondratiuk