pdftools_sdk.pdf2_image.png_image_options

Classes

PngImageOptions()

The settings for PNG output images

class pdftools_sdk.pdf2_image.png_image_options.PngImageOptions[source]

Bases: ImageOptions

The settings for PNG output images

For the output file name, it is recommended to use the file extension “.png”.

__init__()[source]
property background: BackgroundType

Combine a background with the image

This property allows a choice of which background to combine with the image.

Default is pdftools_sdk.pdf2_image.background_type.BackgroundType.WHITE

Returns:

pdftools_sdk.pdf2_image.background_type.BackgroundType

property color_space: PngColorSpace

The color space of the output image

Get or set the color space.

Default is pdftools_sdk.pdf2_image.png_color_space.PngColorSpace.RGB

Returns:

pdftools_sdk.pdf2_image.png_color_space.PngColorSpace

property bits_per_pixel: int

The number of bits per pixel for indexed output

Get or set the index width used for indexed (palette) output. The value determines the maximum number of palette colors (2 to the power of the bits per pixel), and hence the file size. Valid values are 1, 2, 4 and 8.

This property only applies when pdftools_sdk.pdf2_image.png_color_space.PngColorSpace.INDEXED is selected as the pdftools_sdk.pdf2_image.png_image_options.PngImageOptions.color_space ; it is ignored for pdftools_sdk.pdf2_image.png_color_space.PngColorSpace.RGB and pdftools_sdk.pdf2_image.png_color_space.PngColorSpace.GRAY .

Default is 8

Returns:

int