API Option Types¶
gotenberg_client.options.CookieJar dataclass ¶
A cookie to send with Chromium requests.
See https://gotenberg.dev/docs/routes#cookies-chromium
Attributes:
| Name | Type | Description |
|---|---|---|
name | str | The cookie name. |
value | str | The cookie value. |
domain | str | The domain the cookie applies to. |
path | str | None | The URL path the cookie applies to. |
secure | bool | None | Whether the cookie is only sent over HTTPS. |
http_only | bool | None | Whether the cookie is inaccessible to JavaScript. |
same_site | str | None | SameSite policy — |
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. |
gotenberg_client.options.PageOrientation ¶
Represents the possible orientations for a page in Gotenberg.
Attributes:
| Name | Type | Description |
|---|---|---|
Landscape | Horizontal page orientation. | |
Portrait | Vertical page orientation. |
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. |
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 | MeasurementUnitType | The unit of measurement for the measurement. |
gotenberg_client.options.PdfAFormat ¶
Represents different PDF/A archival formats supported by Gotenberg.
Documentation
- https://gotenberg.dev/docs/routes#pdfa-chromium
- https://gotenberg.dev/docs/routes#pdfa-libreoffice
- https://gotenberg.dev/docs/routes#convert-into-pdfa--pdfua-route
- https://gotenberg.dev/docs/routes#merge-pdfs-route
Attributes:
| Name | Type | Description |
|---|---|---|
A1a | PDF/A-1a (deprecated). | |
A1b | PDF/A-1b. | |
A2b | PDF/A-2b. | |
A3b | PDF/A-3b. |
gotenberg_client.options.TrappedStatus ¶
Valid values for the PDF Trapped metadata key.
Attributes:
| Name | Type | Description |
|---|---|---|
TRUE | Trapping has been applied to the document. | |
FALSE | Trapping has not been applied. | |
UNKNOWN | Trapping status is unknown. |
gotenberg_client.options.WatermarkStampSource ¶
Source type for watermark or stamp content.
Attributes:
| Name | Type | Description |
|---|---|---|
Text | Watermark/stamp content is plain text. | |
Image | Watermark/stamp content is an image file. | |
Pdf | Watermark/stamp content is a PDF file. |
gotenberg_client.options.WatermarkStampOptions dataclass ¶
Advanced options for watermark/stamp rendering. Field names and semantics depend on the configured PDF engine (pdfcpu by default). See https://gotenberg.dev/docs/manipulate-pdfs/watermark-pdfs for details.
Attributes:
| Name | Type | Description |
|---|---|---|
font | str | None | Font name for text watermarks/stamps. |
points | int | None | Font size in points. |
color | str | None | Font color as a hex string (e.g. |
rotation | int | None | Rotation angle in degrees. |
opacity | float | None | Opacity between 0.0 (transparent) and 1.0 (opaque). |
scale | float | None | Scale factor relative to the page size. |
gotenberg_client.options.RotateAngle ¶
Valid rotation angles in degrees.
Attributes:
| Name | Type | Description |
|---|---|---|
Clockwise90 | Rotate 90 degrees clockwise. | |
Clockwise180 | Rotate 180 degrees. | |
Clockwise270 | Rotate 270 degrees clockwise (90 degrees counter-clockwise). |
gotenberg_client.options.DownloadFromUrl dataclass ¶
Instructs Gotenberg to fetch a file from a URL instead of a direct upload. See https://gotenberg.dev/docs/webhook-download for details.
Attributes:
| Name | Type | Description |
|---|---|---|
url | str | URL of the file. The remote server must return a |
extra_http_headers | dict[str, str] | None | Extra HTTP headers to send when fetching this URL. |
embedded | bool | Whether to embed the file (legacy; prefer |
field | str | None | Routes the downloaded file to a specific form field: |
gotenberg_client.options.InitialView ¶
Controls which panel is open in the PDF viewer on initial display.
Used with the LibreOffice route's initial_view() method.
Attributes:
| Name | Type | Description |
|---|---|---|
NONE | No panel open (default). | |
OUTLINE | Show document outline/bookmarks panel. | |
THUMBNAILS | Show page thumbnails panel. |
gotenberg_client.options.MagnificationOption ¶
Controls the initial magnification/zoom level used by the PDF viewer.
Used with the LibreOffice route's magnification() method.
Attributes:
| Name | Type | Description |
|---|---|---|
DEFAULT | Use the viewer default. | |
FIT_PAGE | Fit the entire page in the window. | |
FIT_WIDTH | Fit the page width in the window. | |
FIT_HEIGHT | Fit the page height in the window. | |
FIT_BOX | Fit the bounding box of the page in the window. |
gotenberg_client.options.PageLayout ¶
Controls the page layout mode used by the PDF viewer on initial display.
Used with the LibreOffice route's page_layout() method.
Attributes:
| Name | Type | Description |
|---|---|---|
DEFAULT | Use the viewer default. | |
SINGLE_PAGE | Display one page at a time. | |
CONTINUOUS | Display pages in a continuous vertical column. | |
TWO_COLUMNS | Display two pages side by side. |