pdftools_toolbox.sdk

Classes

Sdk(handle)

Initialize the Toolbox add-on, manage its licensing, font directories, and get the value that will be written to the Producer metadata.

class pdftools_toolbox.sdk.Sdk(handle)[source]

Bases: _NativeObject

Initialize the Toolbox add-on, manage its licensing, font directories, and get the value that will be written to the Producer metadata.

static initialize(license: str, producer_suffix: str | None) None[source]

Initialize the Toolbox add-on, providing a license key and default Producer value.

Parameters:
  • license (str)

  • producerSuffix (Optional[str])

Raises:
static add_font_directory(directory: str) None[source]

Add custom font directory

Parameters:

directory (str) – The path of the directory which contains additional font files to be considered during processing.

Raises:

pdftools_toolbox.not_found_error.NotFoundError – The given directory path does not exist.

static get_version() str[source]

The version of the Toolbox add-on

Returns:

str

static get_producer_full_name() str[source]

The value that will be written by default to the Producer property of a document that is created with the Sdk.

Returns:

str

static get_licensing_service() str[source]

Licensing service to use for all licensing requests

This property is relevant only for page-based licenses and is used to set the Licensing Gateway Service.

The default is “https://licensing.pdf-tools.com/api/v1/licenses/” for the online Pdftools Licensing Service. If you plan to use the Licensing Gateway Service instead of the Pdftools Licensing Service, the property’s value must be a URI with the following elements:

http[s]://[‹user›[:‹password›]@]‹host›[:‹port›]

Where:

  • http/https: Protocol for connection to the Licensing Gateway Service.

  • ‹user›:‹password› (optional): Credentials for connection to the Licensing Gateway Service (basic authorization).

  • ‹host›: Hostname of the Licensing Gateway Service.

  • ‹port›: Port for connection to the Licensing Gateway Service.

Example: “http://localhost:9999”

Returns:

str

static set_licensing_service(val: str) None[source]

Licensing service to use for all licensing requests

This property is relevant only for page-based licenses and is used to set the Licensing Gateway Service.

The default is “https://licensing.pdf-tools.com/api/v1/licenses/” for the online Pdftools Licensing Service. If you plan to use the Licensing Gateway Service instead of the Pdftools Licensing Service, the property’s value must be a URI with the following elements:

http[s]://[‹user›[:‹password›]@]‹host›[:‹port›]

Where:

  • http/https: Protocol for connection to the Licensing Gateway Service.

  • ‹user›:‹password› (optional): Credentials for connection to the Licensing Gateway Service (basic authorization).

  • ‹host›: Hostname of the Licensing Gateway Service.

  • ‹port›: Port for connection to the Licensing Gateway Service.

Example: “http://localhost:9999”

Parameters:

val (str) – property value

Raises:

ValueError – The URI is invalid.