Class LocationZoomDestination
- 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.LocationZoomDestination
-
public class LocationZoomDestination extends DirectDestination
A destination that points to a specific location on the target page, using a specified zoom factor. The location is displayed in the top left corner of the viewport (if possible).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocationZoomDestination
create(Document targetDocument, Page page, java.lang.Double left, java.lang.Double top, java.lang.Double zoom)
Create a new LocationZoomDestinationjava.lang.Double
getLeft()
The location of the page that is displayed at the left border of the viewport (if possible).java.lang.Double
getTop()
The location of the page that is displayed at the top of the viewport (if possible).java.lang.Double
getZoom()
The zoom factor that is applied when jumping to the destination.-
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 LocationZoomDestination create(Document targetDocument, Page page, java.lang.Double left, java.lang.Double top, java.lang.Double zoom)
Create a new LocationZoomDestination
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.left
-The location of the page that is displayed at the left border of the viewport or
null
.See property
getLeft()
for more information.top
-The location of the page that is displayed at the top of the viewport or
null
.See property
getTop()
for more information.zoom
-The zoom factor that is applied when jumping to the destination or
null
.See property
getZoom()
for more information.- Returns:
- The newly created destination object.
- Throws:
java.lang.IllegalArgumentException
- if thetargetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- if thetargetDocument
differs from the document associated withpage
java.lang.IllegalArgumentException
- If the document associated with thepage
argument has already been closedjava.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- ifpage
isnull
-
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.
-
getTop
public java.lang.Double getTop()
The location of the page that is displayed at the top of the viewport (if possible).
If the property is
null
, the value from before the jump is retained.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.
-
getZoom
public java.lang.Double getZoom()
The zoom factor that is applied when jumping to the destination.
A value of
null
means that the current zoom level is retained.Note: Many PDF viewers support different viewing modes like "fit page" or "fit width".
A
LocationZoomDestination
with agetZoom()
value ofnull
will usually not change the current viewing mode in most viewers.For other
getZoom()
values however, the viewer must switch to the standard mode, i.e. deactivate special modes like "fit page" or "fit width".Because of this, using a
getZoom()
value other thannull
is discouraged.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.
-
-