/** * Get the annotations rollover appearance. * * <p> * This will get the annotations rollover appearance. If this is not * existent an empty appearance entry will be created. * * @return the appearance entry representing the rollover appearance. */ PDAppearanceEntry getRolloverAppearance() { PDAppearanceDictionary appearanceDictionary = getAppearance(); PDAppearanceEntry rolloverAppearanceEntry = appearanceDictionary.getRolloverAppearance(); if (rolloverAppearanceEntry.isSubDictionary()) { //TODO replace with "document.getDocument().createCOSStream()" rolloverAppearanceEntry = new PDAppearanceEntry(new COSStream()); appearanceDictionary.setRolloverAppearance(rolloverAppearanceEntry); } return rolloverAppearanceEntry; }
/** * Get the annotations rollover appearance. * * <p> * This will get the annotations rollover appearance. If this is not * existent an empty appearance entry will be created. * * @return the appearance entry representing the rollover appearance. */ PDAppearanceEntry getRolloverAppearance() { PDAppearanceDictionary appearanceDictionary = getAppearance(); PDAppearanceEntry appearanceEntry = appearanceDictionary.getRolloverAppearance(); if (appearanceEntry.isSubDictionary()) { appearanceEntry = new PDAppearanceEntry(new COSStream()); appearanceDictionary.setRolloverAppearance(appearanceEntry); } return appearanceEntry; }
PDAppearanceStream down = createAppearanceStream(document, textWidth, font, "0 0 0 rg"); appearanceDictionary.setNormalAppearance(normal); appearanceDictionary.setRolloverAppearance(rollover); appearanceDictionary.setDownAppearance(down); annotation.setAppearance(appearanceDictionary);