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.
Modifier and Type | Method and Description |
---|---|
static FitRectangleDestination |
create(Document targetDocument,
Page page,
Rectangle rectangle)
Create a new FitRectangleDestination
|
static FitRectangleDestination |
createDynamicObject(long handle) |
Rectangle |
getRectangle()
The rectangle that is displayed in the viewport.
|
getPage
getTarget
equals, hashCode
public static FitRectangleDestination createDynamicObject(long handle)
public static FitRectangleDestination create(Document targetDocument, Page page, Rectangle rectangle)
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.
java.lang.IllegalArgumentException
- if the targetDocument
argument is null
java.lang.IllegalArgumentException
- if the targetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if the targetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- if the targetDocument
differs from the document associated with page
java.lang.IllegalArgumentException
- If the page
argument is null
.java.lang.IllegalArgumentException
- If the page
argument is already closed.java.lang.IllegalArgumentException
- if rectangle
is null
public Rectangle getRectangle()
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.