Skip to content

API Clients

gotenberg_client.SyncGotenbergClient

A synchronous client for interacting with a Gotenberg instance.

This client provides methods to interact with various Gotenberg APIs, including:

Attributes

chromium: SyncChromiumApi property

Returns a new instance for interacting with Chromium routes for the conversion of URLs, HTML, Markdown into PDFs and the generation of screenshots from those types

flatten: SyncFlattenApi property

Returns a new instance for interacting with Flatten PDFs route for flattening PDFs

health: SyncHealthCheckApi property

Returns a new instance for reading the Health route

libre_office: SyncLibreOfficeApi property

Returns a new instance for interacting with Libreoffice routes for the conversion of a variety of office documents into PDFs

merge: SyncMergePdfsApi property

Returns a new instance for interacting with Merge PDFs route for merging multiple PDFs into one

metadata: SyncPdfMetadataApi property

Returns a new instance for interacting with Read PDF Metadata and Write PDF Metadata routes for the manipulation or reading of metadata

pdf_convert: SyncPdfAApi property

Returns a new instance for interacting with PDF/A & PDF/UA routes for the conversion of PDFs to PDF/A and/or PDF/UA

split: SyncSplitApi property

Returns a new instance for interacting with Split PDFs route for splitting PDFs

version: SyncOrAsyncApiT property

Returns a new instance for reading the Version route

Raises:

Type Description
NotImplementedError

This API is not yet implemented

Functions

add_error_webhook_url(url: str) -> None

Configure the webhook error URL value.

Parameters:

Name Type Description Default
url str

The URL to be used as the webhook endpoint.

required

add_headers(header: dict[str, str]) -> None

Add custom headers to the request, such as authentication, etc

Parameters:

Name Type Description Default
header Dict[str, str]

A dictionary of header names and values to add.

required

add_webhook_url(url: str) -> None

Configure the webhook URL value.

Parameters:

Name Type Description Default
url str

The URL to be used as the webhook endpoint.

required

close() -> None

Close the underlying HTTP client connection.

set_error_webhook_http_method(method: Literal['POST', 'PATCH', 'PUT']) -> None

Set the HTTP method Gotenberg will use to call the error webhook url.

Args: method: The HTTP method to use.

set_webhook_extra_headers(extra_headers: dict[str, str]) -> None

Add custom headers to the webhook request, such as authentication, etc

Parameters:

Name Type Description Default
extra_headers Dict[str, str]

A dictionary of additional headers to include in webhook calls.

required

set_webhook_http_method(method: Literal['POST', 'PATCH', 'PUT']) -> None

Set the HTTP method Gotenberg will use to call the webhook url.

Parameters:

Name Type Description Default
method Literal['POST', 'PATCH', 'PUT']

The HTTP method to use.

required

gotenberg_client.AsyncGotenbergClient

An asynchronous client for interacting with a Gotenberg instance.

This client provides methods to interact with various Gotenberg APIs, including:

Attributes

chromium: AsyncChromiumApi property

Returns a new instance for interacting with Chromium routes for the conversion of URLs, HTML, Markdown into PDFs and the generation of screenshots from those types

flatten: AyncFlattenApi property

Returns a new instance for interacting with Flatten PDFs route for flattening PDFs

health: AsyncHealthCheckApi property

Returns a new instance for reading the Health route

libre_office: AsyncLibreOfficeApi property

Returns a new instance for interacting with Libreoffice routes for the conversion of a variety of office documents into PDFs

merge: AsyncMergePdfsApi property

Returns a new instance for interacting with Merge PDFs route for merging multiple PDFs into one

metadata: AsyncPdfMetadataApi property

Returns a new instance for interacting with Read PDF Metadata and Write PDF Metadata routes for the manipulation or reading of metadata

pdf_convert: AsyncPdfAApi property

Returns a new instance for interacting with PDF/A & PDF/UA routes for the conversion of PDFs to PDF/A and/or PDF/UA

split: AyncSplitApi property

Returns a new instance for interacting with Split PDFs route for splitting PDFs

version: SyncOrAsyncApiT property

Returns a new instance for reading the Version route

Raises:

Type Description
NotImplementedError

This API is not yet implemented

Functions

add_error_webhook_url(url: str) -> None

Configure the webhook error URL value.

Parameters:

Name Type Description Default
url str

The URL to be used as the webhook endpoint.

required

add_headers(header: dict[str, str]) -> None

Add custom headers to the request, such as authentication, etc

Parameters:

Name Type Description Default
header Dict[str, str]

A dictionary of header names and values to add.

required

add_webhook_url(url: str) -> None

Configure the webhook URL value.

Parameters:

Name Type Description Default
url str

The URL to be used as the webhook endpoint.

required

close() -> None async

Close the underlying asynchronous HTTP client connection.

set_error_webhook_http_method(method: Literal['POST', 'PATCH', 'PUT']) -> None

Set the HTTP method Gotenberg will use to call the error webhook url.

Args: method: The HTTP method to use.

set_webhook_extra_headers(extra_headers: dict[str, str]) -> None

Add custom headers to the webhook request, such as authentication, etc

Parameters:

Name Type Description Default
extra_headers Dict[str, str]

A dictionary of additional headers to include in webhook calls.

required

set_webhook_http_method(method: Literal['POST', 'PATCH', 'PUT']) -> None

Set the HTTP method Gotenberg will use to call the webhook url.

Parameters:

Name Type Description Default
method Literal['POST', 'PATCH', 'PUT']

The HTTP method to use.

required