Package com.pdftools.image2pdf
Class ShrinkToFit
java.lang.Object
com.pdftools.internal.NativeBase
com.pdftools.internal.NativeObject
com.pdftools.image2pdf.ImageMapping
com.pdftools.image2pdf.ShrinkToFit
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 ontogetPageSize().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether to force images to fit into the page (Getter)The page margin (Getter)The page size (Getter)voidsetForceFit(boolean value) Whether to force images to fit into the page (Setter)voidsetPageMargin(Margin value) The page margin (Setter)voidsetPageSize(Size value) The page size (Setter)Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
Constructor Details
-
ShrinkToFit
public ShrinkToFit()
-
-
Method Details
-
getPageSize
The page size (Getter)
All output pages are created as that size.
Default value: "A4" (210mm 297mm)
-
setPageSize
The page size (Setter)
All output pages are created as that size.
Default value: "A4" (210mm 297mm)
- Throws:
IllegalArgumentException- The argument is smaller than "3pt 3pt" or larger than "14400pt 14400pt".IllegalArgumentException- ifvalueisnull
-
getPageMargin
The page margin (Getter)
Default value: 20mm (0.79in) -
setPageMargin
The page margin (Setter)
Default value: 20mm (0.79in)- Throws:
IllegalArgumentException- The argument has negative margin values.IllegalArgumentException- ifvalueisnull
-
getForceFit
public boolean getForceFit()Whether to force images to fit into the page (Getter)
If an image is smaller than the specified
getPageSize(), it will be scaled up respecting the aspect ratio to fit within the page dimensions.Default:
false -
setForceFit
public void setForceFit(boolean value) Whether to force images to fit into the page (Setter)
If an image is smaller than the specified
getPageSize(), it will be scaled up respecting the aspect ratio to fit within the page dimensions.Default:
false
-