feat(chromium): add clip options to screenshot routes

This commit is contained in:
Julien Neuhart
2024-04-25 17:24:23 +02:00
parent a890968ee4
commit 0f0a6ce042
6 changed files with 107 additions and 0 deletions

View File

@@ -239,6 +239,19 @@ func DefaultPdfOptions() PdfOptions {
type ScreenshotOptions struct {
Options
// Width is the device screen width in pixels.
// Optional.
Width int
// Height is the device screen height in pixels.
// Optional.
Height int
// Clip defines whether to clip the screenshot according to the device
// dimensions.
// Optional.
Clip bool
// Format is the image compression format, either "png" or "jpeg" or
// "webp".
// Optional.
@@ -258,6 +271,9 @@ type ScreenshotOptions struct {
func DefaultScreenshotOptions() ScreenshotOptions {
return ScreenshotOptions{
Options: DefaultOptions(),
Width: 800,
Height: 600,
Clip: false,
Format: "png",
Quality: 100,
OptimizeForSpeed: false,