Class PDTransition
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.common.PDDictionaryWrapper
-
- org.apache.pdfbox.pdmodel.interactive.pagenavigation.PDTransition
-
- All Implemented Interfaces:
COSObjectable
public final class PDTransition extends PDDictionaryWrapper
Represents a page transition as defined in paragraph 12.4.4.1 of PDF 32000-1:2008
-
-
Constructor Summary
Constructors Constructor Description PDTransition()
creates a new transition with default "replace" stylePDTransitionStyle.R
PDTransition(COSDictionary dictionary)
creates a new transition for an existing dictionaryPDTransition(PDTransitionStyle style)
creates a new transition with the given style.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDimension()
COSBase
getDirection()
float
getDuration()
float
getFlyScale()
java.lang.String
getMotion()
java.lang.String
getStyle()
boolean
isFlyAreaOpaque()
void
setDimension(PDTransitionDimension dimension)
Sets the dimension in which the specified transition effect shall occur.void
setDirection(PDTransitionDirection direction)
Sets the direction in which the specified transition effect shall moves.void
setDuration(float duration)
void
setFlyAreaOpaque(boolean opaque)
void
setFlyScale(float scale)
void
setMotion(PDTransitionMotion motion)
Sets the direction of motion for the specified transition effect.-
Methods inherited from class org.apache.pdfbox.pdmodel.common.PDDictionaryWrapper
equals, getCOSObject, hashCode
-
-
-
-
Constructor Detail
-
PDTransition
public PDTransition()
creates a new transition with default "replace" stylePDTransitionStyle.R
-
PDTransition
public PDTransition(PDTransitionStyle style)
creates a new transition with the given style.- Parameters:
style
- the style to be used.
-
PDTransition
public PDTransition(COSDictionary dictionary)
creates a new transition for an existing dictionary- Parameters:
dictionary
- the dictionary to be used.
-
-
Method Detail
-
getStyle
public java.lang.String getStyle()
- Returns:
- the style for this transition
- See Also:
PDTransitionStyle.valueOf(String)
-
getDimension
public java.lang.String getDimension()
- Returns:
- The dimension in which the specified transition effect shall occur or the default
PDTransitionDimension.H
if no dimension is found. - See Also:
PDTransitionDimension
-
setDimension
public void setDimension(PDTransitionDimension dimension)
Sets the dimension in which the specified transition effect shall occur. Only forPDTransitionStyle.Split
andPDTransitionStyle.Blinds
.- Parameters:
dimension
- the dimension.
-
getMotion
public java.lang.String getMotion()
- Returns:
- The direction of motion for the specified transition effect or the default
PDTransitionMotion.I
if no motion is found. - See Also:
PDTransitionMotion
-
setMotion
public void setMotion(PDTransitionMotion motion)
Sets the direction of motion for the specified transition effect. Only forPDTransitionStyle.Split
,PDTransitionStyle.Blinds
andPDTransitionStyle.Fly
.- Parameters:
motion
- the motion for the specified effect.
-
getDirection
public COSBase getDirection()
- Returns:
- the direction in which the specified transition effect shall moves. It can be either a
COSInteger
orCOSName.NONE
. Default toCOSInteger.ZERO
- See Also:
PDTransitionDirection
-
setDirection
public void setDirection(PDTransitionDirection direction)
Sets the direction in which the specified transition effect shall moves. Only forPDTransitionStyle.Wipe
,PDTransitionStyle.Glitter
,PDTransitionStyle.Fly
,PDTransitionStyle.Cover
,PDTransitionStyle.Uncover
andPDTransitionStyle.Push
.- Parameters:
direction
- the direction in which the specified transition effect shall move.
-
getDuration
public float getDuration()
- Returns:
- The duration in seconds of the transition effect or the default 1 if no duration is found.
-
setDuration
public void setDuration(float duration)
- Parameters:
duration
- The duration of the transition effect, in seconds.
-
getFlyScale
public float getFlyScale()
- Returns:
- The starting or ending scale at which the changes shall be drawn or the default 1 if no scale is found.
Only for
PDTransitionStyle.Fly
.
-
setFlyScale
public void setFlyScale(float scale)
- Parameters:
scale
- The starting or ending scale at which the changes shall be drawn. Only forPDTransitionStyle.Fly
.
-
isFlyAreaOpaque
public boolean isFlyAreaOpaque()
- Returns:
- true if the area that shall be flown in is rectangular and opaque. Default is false. Only for
PDTransitionStyle.Fly
.
-
setFlyAreaOpaque
public void setFlyAreaOpaque(boolean opaque)
- Parameters:
opaque
- If true, the area that shall be flown in is rectangular and opaque. Only forPDTransitionStyle.Fly
.
-
-