pdftools_sdk.image2_pdf.shrink_to_fit

Classes

ShrinkToFit()

The image mapping that places the image onto pages of the specified size

class pdftools_sdk.image2_pdf.shrink_to_fit.ShrinkToFit[source]

Bases: ImageMapping

The image mapping that places the image onto pages of the specified size

Place images onto portrait or landscape pages. Large images are scaled down to fit onto pdftools_sdk.image2_pdf.shrink_to_fit.ShrinkToFit.page_size .

__init__()[source]
property page_size: Size

The page size

All output pages are created as that size.

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

Returns:

pdftools_sdk.geometry.units.size.Size

property page_margin: Margin

The page margin

Default value: 20mm (0.79in)

Returns:

pdftools_sdk.geometry.units.margin.Margin

property force_fit: bool

Whether to force images to fit into the page

If an image is smaller than the specified pdftools_sdk.image2_pdf.shrink_to_fit.ShrinkToFit.page_size , it will be scaled up respecting the aspect ratio to fit within the page dimensions.

Default is False

Returns:

bool