pdftools_sdk.image2_pdf.auto

Classes

Auto()

The image mapping that automatically determines a suitable conversion

class pdftools_sdk.image2_pdf.auto.Auto[source]

Bases: ImageMapping

The image mapping that automatically determines a suitable conversion

Images with a meaningful resolution, e.g. scans or graphics, are converted to PDF pages fitting the image. The image size is preserved if it is smaller than pdftools_sdk.image2_pdf.auto.Auto.max_page_size . Otherwise, it is scaled down. For all images except scans, a margin pdftools_sdk.image2_pdf.auto.Auto.default_page_margin is used.

Images with no meaningful resolution, e.g. photos are scaled, to fit onto pdftools_sdk.image2_pdf.auto.Auto.max_page_size .

__init__()[source]
property max_page_size: Size

The maximum page size

Each image is scaled individually such that neither the width nor the height exceeds the maximum page size. For landscape images the maximum page size is assumed to be landscape, and equivalently for portrait images.

Default value: “A4” (210mm 297mm)

Returns:

pdftools_sdk.geometry.units.size.Size

property default_page_margin: Margin

The default page margin

Default value: 20mm (0.79in)

Returns:

pdftools_sdk.geometry.units.margin.Margin