mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 20:32:13 +01:00
chore(chromium): remove some 'Optional' comments
This commit is contained in:
@@ -76,55 +76,44 @@ type Options struct {
|
|||||||
// "networkIdle" event, drastically improving the conversion speed. It may
|
// "networkIdle" event, drastically improving the conversion speed. It may
|
||||||
// not be suitable for all HTML documents, as some may not be fully
|
// not be suitable for all HTML documents, as some may not be fully
|
||||||
// rendered until this event is fired.
|
// rendered until this event is fired.
|
||||||
// Optional.
|
|
||||||
SkipNetworkIdleEvent bool
|
SkipNetworkIdleEvent bool
|
||||||
|
|
||||||
// FailOnHttpStatusCodes sets if the conversion should fail if the status
|
// FailOnHttpStatusCodes sets if the conversion should fail if the status
|
||||||
// code from the main page matches with one of its entries.
|
// code from the main page matches with one of its entries.
|
||||||
// Optional.
|
|
||||||
FailOnHttpStatusCodes []int64
|
FailOnHttpStatusCodes []int64
|
||||||
|
|
||||||
// FailOnConsoleExceptions sets if the conversion should fail if there are
|
// FailOnConsoleExceptions sets if the conversion should fail if there are
|
||||||
// exceptions in the Chromium console.
|
// exceptions in the Chromium console.
|
||||||
// Optional.
|
|
||||||
FailOnConsoleExceptions bool
|
FailOnConsoleExceptions bool
|
||||||
|
|
||||||
// WaitDelay is the duration to wait when loading an HTML document before
|
// WaitDelay is the duration to wait when loading an HTML document before
|
||||||
// converting it.
|
// converting it.
|
||||||
// Optional.
|
|
||||||
WaitDelay time.Duration
|
WaitDelay time.Duration
|
||||||
|
|
||||||
// WaitWindowStatus is the window.status value to wait for before
|
// WaitWindowStatus is the window.status value to wait for before
|
||||||
// converting an HTML document.
|
// converting an HTML document.
|
||||||
// Optional.
|
|
||||||
WaitWindowStatus string
|
WaitWindowStatus string
|
||||||
|
|
||||||
// WaitForExpression is the custom JavaScript expression to wait before
|
// WaitForExpression is the custom JavaScript expression to wait before
|
||||||
// converting an HTML document until it returns true
|
// converting an HTML document until it returns true
|
||||||
// Optional.
|
|
||||||
WaitForExpression string
|
WaitForExpression string
|
||||||
|
|
||||||
// Cookies are the cookies to put in the Chromium cookies' jar.
|
// Cookies are the cookies to put in the Chromium cookies' jar.
|
||||||
// Optional
|
|
||||||
Cookies []Cookie
|
Cookies []Cookie
|
||||||
|
|
||||||
// UserAgent overrides the default 'User-Agent' HTTP header.
|
// UserAgent overrides the default 'User-Agent' HTTP header.
|
||||||
// Optional.
|
|
||||||
UserAgent string
|
UserAgent string
|
||||||
|
|
||||||
// ExtraHttpHeaders are extra HTTP headers to send by Chromium while
|
// ExtraHttpHeaders are extra HTTP headers to send by Chromium while
|
||||||
// loading he HTML document.
|
// loading he HTML document.
|
||||||
// Optional.
|
|
||||||
ExtraHttpHeaders map[string]string
|
ExtraHttpHeaders map[string]string
|
||||||
|
|
||||||
// EmulatedMediaType is the media type to emulate, either "screen" or
|
// EmulatedMediaType is the media type to emulate, either "screen" or
|
||||||
// "print".
|
// "print".
|
||||||
// Optional.
|
|
||||||
EmulatedMediaType string
|
EmulatedMediaType string
|
||||||
|
|
||||||
// OmitBackground hides default white background and allows generating PDFs
|
// OmitBackground hides default white background and allows generating PDFs
|
||||||
// with transparency.
|
// with transparency.
|
||||||
// Optional.
|
|
||||||
OmitBackground bool
|
OmitBackground bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,48 +139,37 @@ type PdfOptions struct {
|
|||||||
Options
|
Options
|
||||||
|
|
||||||
// Landscape sets the paper orientation.
|
// Landscape sets the paper orientation.
|
||||||
// Optional.
|
|
||||||
Landscape bool
|
Landscape bool
|
||||||
|
|
||||||
// PrintBackground prints the background graphics.
|
// PrintBackground prints the background graphics.
|
||||||
// Optional.
|
|
||||||
PrintBackground bool
|
PrintBackground bool
|
||||||
|
|
||||||
// Scale is the scale of the page rendering.
|
// Scale is the scale of the page rendering.
|
||||||
// Optional.
|
|
||||||
Scale float64
|
Scale float64
|
||||||
|
|
||||||
// SinglePage defines whether to print the entire content in one single
|
// SinglePage defines whether to print the entire content in one single
|
||||||
// page.
|
// page.
|
||||||
// Optional.
|
|
||||||
SinglePage bool
|
SinglePage bool
|
||||||
|
|
||||||
// PaperWidth is the paper width, in inches.
|
// PaperWidth is the paper width, in inches.
|
||||||
// Optional.
|
|
||||||
PaperWidth float64
|
PaperWidth float64
|
||||||
|
|
||||||
// PaperHeight is the paper height, in inches.
|
// PaperHeight is the paper height, in inches.
|
||||||
// Optional.
|
|
||||||
PaperHeight float64
|
PaperHeight float64
|
||||||
|
|
||||||
// MarginTop is the top margin, in inches.
|
// MarginTop is the top margin, in inches.
|
||||||
// Optional.
|
|
||||||
MarginTop float64
|
MarginTop float64
|
||||||
|
|
||||||
// MarginBottom is the bottom margin, in inches.
|
// MarginBottom is the bottom margin, in inches.
|
||||||
// Optional.
|
|
||||||
MarginBottom float64
|
MarginBottom float64
|
||||||
|
|
||||||
// MarginLeft is the left margin, in inches.
|
// MarginLeft is the left margin, in inches.
|
||||||
// Optional.
|
|
||||||
MarginLeft float64
|
MarginLeft float64
|
||||||
|
|
||||||
// MarginRight is the right margin, in inches.
|
// MarginRight is the right margin, in inches.
|
||||||
// Optional.
|
|
||||||
MarginRight float64
|
MarginRight float64
|
||||||
|
|
||||||
// Page ranges to print, e.g., '1-5, 8, 11-13'. Empty means all pages.
|
// Page ranges to print, e.g., '1-5, 8, 11-13'. Empty means all pages.
|
||||||
// Optional.
|
|
||||||
PageRanges string
|
PageRanges string
|
||||||
|
|
||||||
// HeaderTemplate is the HTML template of the header. It should be valid
|
// HeaderTemplate is the HTML template of the header. It should be valid
|
||||||
@@ -204,17 +182,14 @@ type PdfOptions struct {
|
|||||||
// - totalPages: total pages in the document
|
// - totalPages: total pages in the document
|
||||||
// For example, <span class=title></span> would generate span containing
|
// For example, <span class=title></span> would generate span containing
|
||||||
// the title.
|
// the title.
|
||||||
// Optional.
|
|
||||||
HeaderTemplate string
|
HeaderTemplate string
|
||||||
|
|
||||||
// FooterTemplate is the HTML template of the footer. It should use the
|
// FooterTemplate is the HTML template of the footer. It should use the
|
||||||
// same format as the HeaderTemplate.
|
// same format as the HeaderTemplate.
|
||||||
// Optional.
|
|
||||||
FooterTemplate string
|
FooterTemplate string
|
||||||
|
|
||||||
// PreferCssPageSize defines whether to prefer page size as defined by CSS.
|
// PreferCssPageSize defines whether to prefer page size as defined by CSS.
|
||||||
// If false, the content will be scaled to fit the paper size.
|
// If false, the content will be scaled to fit the paper size.
|
||||||
// Optional.
|
|
||||||
PreferCssPageSize bool
|
PreferCssPageSize bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,30 +220,24 @@ type ScreenshotOptions struct {
|
|||||||
Options
|
Options
|
||||||
|
|
||||||
// Width is the device screen width in pixels.
|
// Width is the device screen width in pixels.
|
||||||
// Optional.
|
|
||||||
Width int
|
Width int
|
||||||
|
|
||||||
// Height is the device screen height in pixels.
|
// Height is the device screen height in pixels.
|
||||||
// Optional.
|
|
||||||
Height int
|
Height int
|
||||||
|
|
||||||
// Clip defines whether to clip the screenshot according to the device
|
// Clip defines whether to clip the screenshot according to the device
|
||||||
// dimensions.
|
// dimensions.
|
||||||
// Optional.
|
|
||||||
Clip bool
|
Clip bool
|
||||||
|
|
||||||
// Format is the image compression format, either "png" or "jpeg" or
|
// Format is the image compression format, either "png" or "jpeg" or
|
||||||
// "webp".
|
// "webp".
|
||||||
// Optional.
|
|
||||||
Format string
|
Format string
|
||||||
|
|
||||||
// Quality is the compression quality from range [0..100] (jpeg only).
|
// Quality is the compression quality from range [0..100] (jpeg only).
|
||||||
// Optional.
|
|
||||||
Quality int
|
Quality int
|
||||||
|
|
||||||
// OptimizeForSpeed defines whether to optimize image encoding for speed,
|
// OptimizeForSpeed defines whether to optimize image encoding for speed,
|
||||||
// not for resulting size.
|
// not for resulting size.
|
||||||
// Optional.
|
|
||||||
OptimizeForSpeed bool
|
OptimizeForSpeed bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user