Class Auto
- java.lang.Object
-
- com.pdftools.internal.NativeBase
-
- com.pdftools.internal.NativeObject
-
- com.pdftools.image2pdf.ImageMapping
-
- com.pdftools.image2pdf.Auto
-
public class Auto extends 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
getMaxPageSize()
. Otherwise, it is scaled down. For all images except scans, a margingetDefaultPageMargin()
is used.Images with no meaningful resolution, e.g. photos are scaled, to fit onto
getMaxPageSize()
.
-
-
Constructor Summary
Constructors Constructor Description Auto()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Margin
getDefaultPageMargin()
The default page margin (Getter)Size
getMaxPageSize()
The maximum page size (Getter)void
setDefaultPageMargin(Margin value)
The default page margin (Setter)void
setMaxPageSize(Size value)
The maximum page size (Setter)-
Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
getMaxPageSize
public Size getMaxPageSize()
The maximum page size (Getter)
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)
-
setMaxPageSize
public void setMaxPageSize(Size value)
The maximum page size (Setter)
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)
- Throws:
java.lang.IllegalArgumentException
- The argument is smaller than "3pt 3pt" or larger than "14400pt 14400pt".java.lang.IllegalArgumentException
- ifvalue
isnull
-
getDefaultPageMargin
public Margin getDefaultPageMargin()
The default page margin (Getter)
Default value: 20mm (0.79in)
-
setDefaultPageMargin
public void setDefaultPageMargin(Margin value)
The default page margin (Setter)
Default value: 20mm (0.79in)- Throws:
java.lang.IllegalArgumentException
- The argument has negative margin values.java.lang.IllegalArgumentException
- ifvalue
isnull
-
-