Class FitRectangleDestination
- java.lang.Object
-
- com.pdf_tools.fourheights.pdftoolbox.internal.NativeBase
-
- com.pdf_tools.fourheights.pdftoolbox.internal.NativeObject
-
- com.pdf_tools.fourheights.pdftoolbox.pdf.navigation.Destination
-
- com.pdf_tools.fourheights.pdftoolbox.pdf.navigation.DirectDestination
-
- com.pdf_tools.fourheights.pdftoolbox.pdf.navigation.FitRectangleDestination
-
public class FitRectangleDestination extends DirectDestination
A destination that fits a specified area of a page into the viewport.
Note: Many PDF viewers support different viewing modes like "fit page" or "fit width". A
FitRectangleDestination
will change the current viewing mode to standard mode in those viewers, i.e. deactivate any special mode like "fit page" or "fit width".Changing the viewing mode is usually not very well received by users and thus a
LocationZoomDestination
should be preferred in most cases.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FitRectangleDestination
create(Document targetDocument, Page page, Rectangle rectangle)
Create a new FitRectangleDestinationRectangle
getRectangle()
The rectangle that is displayed in the viewport.-
Methods inherited from class com.pdf_tools.fourheights.pdftoolbox.pdf.navigation.DirectDestination
getPage
-
Methods inherited from class com.pdf_tools.fourheights.pdftoolbox.pdf.navigation.Destination
getTarget
-
Methods inherited from class com.pdf_tools.fourheights.pdftoolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static FitRectangleDestination create(Document targetDocument, Page page, Rectangle rectangle)
Create a new FitRectangleDestination
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.rectangle
-The rectangle that is displayed in the viewport.
See property
getRectangle()
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
java.lang.IllegalArgumentException
- ifrectangle
isnull
-
getRectangle
public Rectangle getRectangle()
The rectangle that is displayed in the viewport.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.
-
-