Class FitHeightDestination
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.navigation.Destination
-
- com.pdftools.toolbox.pdf.navigation.DirectDestination
-
- com.pdftools.toolbox.pdf.navigation.FitHeightDestination
-
public class FitHeightDestination extends DirectDestination
A destination fits the height of a page into the viewport.
Note: Many PDF viewers support different viewing modes like "fit page" or "fit width". A
FitHeightDestinationwill change the current viewing mode to "fit height" in those viewers.Changing the viewing mode is usually not very well received by users and thus a
LocationZoomDestinationshould be preferred in most cases.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FitHeightDestinationcreate(Document targetDocument, Page page, boolean fitActualContent)Create a new FitHeightDestinationstatic FitHeightDestinationcreate(Document targetDocument, Page page, boolean fitActualContent, java.lang.Double left)Create a new FitHeightDestinationbooleangetFitActualContent()Iftrue, the viewport is fitted to the width of the actual content of the page, instead of the width of the page.java.lang.DoublegetLeft()The location of the page that is displayed at the left border of the viewport (if possible).-
Methods inherited from class com.pdftools.toolbox.pdf.navigation.DirectDestination
getPage
-
Methods inherited from class com.pdftools.toolbox.pdf.navigation.Destination
getTarget
-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static FitHeightDestination create(Document targetDocument, Page page, boolean fitActualContent)
Create a new FitHeightDestination
The returned object is not yet used on any page, but it is associated with the given target document.- Parameters:
targetDocument- The output document with which the returned object is associatedpage- The page in the document that this destination is pointing to.fitActualContent-If
true, the viewport is fitted to the actual content of the page, instead of the size of the page.See property
getFitActualContent()for more information.- Returns:
- The newly created destination object.
- Throws:
java.lang.IllegalArgumentException- if thetargetDocumentargument has already been closedjava.lang.IllegalArgumentException- if thetargetDocumentargument is read-onlyjava.lang.IllegalArgumentException- if thetargetDocumentdiffers from the document associated withpagejava.lang.IllegalArgumentException- If the document associated with thepageargument has already been closedjava.lang.IllegalArgumentException- iftargetDocumentisnulljava.lang.IllegalArgumentException- ifpageisnull
-
create
public static FitHeightDestination create(Document targetDocument, Page page, boolean fitActualContent, java.lang.Double left)
Create a new FitHeightDestination
The returned object is not yet used on any page, but it is associated with the given target document.- Parameters:
targetDocument- The output document with which the returned object is associatedpage- The page in the document that this destination is pointing to.fitActualContent-If
true, the viewport is fitted to the actual content of the page, instead of the size of the page.See property
getFitActualContent()for more information.left-The location of the page that is displayed at the left border of the viewport or
null.See property
getLeft()for more information.- Returns:
- The newly created destination object.
- Throws:
java.lang.IllegalArgumentException- if thetargetDocumentargument has already been closedjava.lang.IllegalArgumentException- if thetargetDocumentargument is read-onlyjava.lang.IllegalArgumentException- if thetargetDocumentdiffers from the document associated withpagejava.lang.IllegalArgumentException- If the document associated with thepageargument has already been closedjava.lang.IllegalArgumentException- iftargetDocumentisnulljava.lang.IllegalArgumentException- ifpageisnull
-
getFitActualContent
public boolean getFitActualContent()
If
true, the viewport is fitted to the width of the actual content of the page, instead of the width of the page.Note: Many PDF viewers simply ignore this property and always treat it as
false, i.e. switching to "fit page" mode anyway.- Throws:
java.lang.IllegalStateException- the object has already been closed.java.lang.IllegalStateException- the associated document has already been closed.
-
getLeft
public java.lang.Double getLeft()
The location of the page that is displayed at the left border of the viewport (if possible).
If the property is
null, the value from before the jump is retained.Note: Due to the current zoom factor, it is usually not possible for viewers to scroll as far to the right side, as would be necessary to place the location at the left corner of the viewport. However, viewers will ensure, that the location is at least visible.
In practice this means, that this value is mostly irrelevant.
- Throws:
java.lang.IllegalStateException- the object has already been closed.java.lang.IllegalStateException- the associated document has already been closed.
-
-