org.pdfbox.pdmodel.interactive.annotation

Class PDAppearanceDictionary

Implemented Interfaces:
COSObjectable

public class PDAppearanceDictionary
extends java.lang.Object
implements COSObjectable

This class represents a PDF /AP entry the appearance dictionary.
Version:
$Revision: 1.4 $
Author:
Ben Litchfield

Constructor Summary

PDAppearanceDictionary()
Constructor.
PDAppearanceDictionary(COSDictionary dict)
Constructor.

Method Summary

COSBase
getCOSObject()
returns the dictionary.
COSDictionary
getDictionary()
returns the dictionary.
Map
getDownAppearance()
This will return a list of appearances.
Map
getNormalAppearance()
This will return a list of appearances.
Map
getRolloverAppearance()
This will return a list of appearances.
void
setDownAppearance(Map appearanceMap)
This will set a list of appearances.
void
setNormalAppearance(Map appearanceMap)
This will set a list of appearances.
void
setNormalAppearance(PDAppearanceStream ap)
This will set the normal appearance when there is only one appearance to be shown.
void
setRolloverAppearance(Map appearanceMap)
This will set a list of appearances.

Constructor Details

PDAppearanceDictionary

public PDAppearanceDictionary()
Constructor.

PDAppearanceDictionary

public PDAppearanceDictionary(COSDictionary dict)
Constructor.
Parameters:
dict - The annotations dictionary.

Method Details

getCOSObject

public COSBase getCOSObject()
returns the dictionary.
Specified by:
getCOSObject in interface COSObjectable
Returns:
the dictionary

getDictionary

public COSDictionary getDictionary()
returns the dictionary.
Returns:
the dictionary

getDownAppearance

public Map getDownAppearance()
This will return a list of appearances. In the case where there is only one appearance the map will contain one entry whose key is the string "default". If there is no rollover appearance then the normal appearance will be returned. Which means that this method will never return null.
Returns:
A list of key(java.lang.String) value(PDAppearanceStream) pairs

getNormalAppearance

public Map getNormalAppearance()
This will return a list of appearances. In the case where there is only one appearance the map will contain one entry whose key is the string "default".
Returns:
A list of key(java.lang.String) value(PDAppearanceStream) pairs

getRolloverAppearance

public Map getRolloverAppearance()
This will return a list of appearances. In the case where there is only one appearance the map will contain one entry whose key is the string "default". If there is no rollover appearance then the normal appearance will be returned. Which means that this method will never return null.
Returns:
A list of key(java.lang.String) value(PDAppearanceStream) pairs

setDownAppearance

public void setDownAppearance(Map appearanceMap)
This will set a list of appearances. If you would like to set the single appearance then you should use the key "default", and when the PDF is written back to the filesystem then there will only be one stream.
Parameters:
appearanceMap - The updated map with the appearance.

setNormalAppearance

public void setNormalAppearance(Map appearanceMap)
This will set a list of appearances. If you would like to set the single appearance then you should use the key "default", and when the PDF is written back to the filesystem then there will only be one stream.
Parameters:
appearanceMap - The updated map with the appearance.

setNormalAppearance

public void setNormalAppearance(PDAppearanceStream ap)
This will set the normal appearance when there is only one appearance to be shown.
Parameters:
ap - The appearance stream to show.

setRolloverAppearance

public void setRolloverAppearance(Map appearanceMap)
This will set a list of appearances. If you would like to set the single appearance then you should use the key "default", and when the PDF is written back to the filesystem then there will only be one stream.
Parameters:
appearanceMap - The updated map with the appearance.