Class PDTransition
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.common.PDDictionaryWrapper
-
- com.tom_roush.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.RPDTransition(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 StringgetDimension()COSBasegetDirection()floatgetDuration()floatgetFlyScale()StringgetMotion()StringgetStyle()booleanisFlyAreaOpaque()voidsetDimension(PDTransitionDimension dimension)Sets the dimension in which the specified transition effect shall occur.voidsetDirection(PDTransitionDirection direction)Sets the direction in which the specified transition effect shall moves.voidsetDuration(float duration)voidsetFlyAreaOpaque(boolean opaque)voidsetFlyScale(float scale)voidsetMotion(PDTransitionMotion motion)Sets the direction of motion for the specified transition effect.-
Methods inherited from class com.tom_roush.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 String getStyle()
- Returns:
- the style for this transition
- See Also:
PDTransitionStyle.valueOf(String)
-
getDimension
public String getDimension()
- Returns:
- The dimension in which the specified transition effect shall occur or the default
PDTransitionDimension.Hif 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.SplitandPDTransitionStyle.Blinds.- Parameters:
dimension- the dimension.
-
getMotion
public String getMotion()
- Returns:
- The direction of motion for the specified transition effect or the default
PDTransitionMotion.Iif 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.BlindsandPDTransitionStyle.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
COSIntegerorCOSName.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.UncoverandPDTransitionStyle.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.
-
-