Skip to content

API Option Types

gotenberg_client.options.CookieJar dataclass

https://gotenberg.dev/docs/routes#cookies-chromium

gotenberg_client.options.PageMarginsType dataclass

Represents the margins for a page in Gotenberg.

Attributes:

Name Type Description
top Optional[Measurement]

The top margin of the page.

bottom Optional[Measurement]

The bottom margin of the page.

left Optional[Measurement]

The left margin of the page.

right Optional[Measurement]

The right margin of the page.

Functions

to_form() -> dict[str, str]

Converts this PageMarginsType object to a dictionary suitable for form data.

Returns:

Type Description
dict[str, str]

A dictionary containing key-value pairs for each margin property with their corresponding Gotenberg names

dict[str, str]

(e.g., "marginTop", "marginBottom", etc.) and the formatted margin values as strings.

gotenberg_client.options.PageOrientation

Represents the possible orientations for a page in Gotenberg.

Functions

to_form() -> dict[str, str]

Converts this PageOrientation enum value to a dictionary suitable for form data.

Returns:

Type Description
dict[str, str]

A dictionary containing a single key-value pair with the key "orientation"

dict[str, str]

and the corresponding Gotenberg value ("landscape" or "portrait") as the value.

gotenberg_client.options.PageSize dataclass

Represents the dimensions of a page in Gotenberg.

Attributes:

Name Type Description
width Optional[Measurement]

The width of the page.

height Optional[Measurement]

The height of the page.

Functions

to_form() -> dict[str, str]

Converts this PageSize object to a dictionary suitable for form data.

Returns:

Type Description
dict[str, str]

A dictionary containing the "paperWidth" and "paperHeight" keys with their corresponding values,

dict[str, str]

if they are not None.

gotenberg_client.options.MeasurementUnitType

Represents the different units of measurement for sizes.

Attributes:

Name Type Description
Undefined

Indicates that no unit is specified. (Gotenberg will use inches )

Points

Represents points (1/72 of an inch).

Pixels

Represents pixels.

Inches

Represents inches.

Millimeters

Represents millimeters.

Centimeters

Represents centimeters.

Percent

Represents a percentage relative to the page size.

gotenberg_client.options.Measurement dataclass

Represents a value with a specified unit of measurement.

Attributes:

Name Type Description
value float or int

The numerical value of the measurement.

unit UnitType

The unit of measurement for the measurement.

Functions

to_form(name: str) -> dict[str, str]

Converts this Measurement object to a dictionary suitable for form data.

Returns:

Type Description
dict[str, str]

A dictionary containing the name with the formatted measurement value, according to the

dict[str, str]

defined units of the measurement