/** * Constructor. */ public PDAnnotationLink() { getCOSObject().setName(COSName.SUBTYPE, SUB_TYPE); }
/** * The new destination value. Either this or the action entry should be set, but not both. * * @param dest The updated destination. */ public void setDestination(PDDestination dest) { getCOSObject().setItem(COSName.DEST, dest); }
/** * Set the annotation action. Either this or the destination entry should be set, but not both. * * @param action The annotation action. * */ public void setAction(PDAction action) { this.getCOSObject().setItem(COSName.A, action); }
/** * This will set the border style dictionary, specifying the width and dash pattern used in drawing the line. * * @param bs the border style dictionary to set. * */ public void setBorderStyle(PDBorderStyleDictionary bs) { this.getCOSObject().setItem(COSName.BS, bs); }
/** * Set the highlight mode for when the mouse is depressed. See the HIGHLIGHT_MODE_XXX constants. * * @return The string representation of the highlight mode. */ public String getHighlightMode() { return getCOSObject().getNameAsString(COSName.H, HIGHLIGHT_MODE_INVERT); }
/** * Set the highlight mode. See the HIGHLIGHT_MODE_XXX constants. * * @param mode The new highlight mode. */ public void setHighlightMode(String mode) { getCOSObject().setName(COSName.H, mode); }
/** * This will set the previous URI action, in case it needs to be retrieved at later date. * * @param pa The previous URI. */ public void setPreviousURI(PDActionURI pa) { getCOSObject().setItem("PA", pa); }
/** * Get the destination to be displayed when the annotation is activated. Either this or the * action entry should be set, but not both. * * @return The destination for this annotation. * * @throws IOException If there is an error creating the destination. */ public PDDestination getDestination() throws IOException { COSBase base = getCOSObject().getDictionaryObject(COSName.DEST); return PDDestination.create(base); }
/** * This will set the previous URI action, in case it's needed. * * @return The previous URI. */ public PDActionURI getPreviousURI() { COSBase base = getCOSObject().getDictionaryObject("PA"); if (base instanceof COSDictionary) { return new PDActionURI((COSDictionary) base); } return null; }
/** * This will retrieve the set of quadpoints which encompass the areas of this annotation which will activate. * * @return An array of floats representing the quad points. */ public float[] getQuadPoints() { COSBase base = getCOSObject().getDictionaryObject(COSName.QUADPOINTS); if (base instanceof COSArray) { return ((COSArray) base).toFloatArray(); } return null; }
/** * Get the action to be performed when this annotation is to be activated. Either this or the * destination entry should be set, but not both. * * @return The action to be performed when this annotation is activated. */ public PDAction getAction() { COSBase base = getCOSObject().getDictionaryObject(COSName.A); if (base instanceof COSDictionary) { return PDActionFactory.createAction((COSDictionary) base); } return null; }
/** * This will retrieve the border style dictionary, specifying the width and dash pattern used in * drawing the line. * * @return the border style dictionary. */ public PDBorderStyleDictionary getBorderStyle() { COSBase bs = getCOSObject().getDictionaryObject(COSName.BS); if (bs instanceof COSDictionary) { return new PDBorderStyleDictionary((COSDictionary) bs); } return null; }
/** * This will set the set of quadpoints which encompass the areas of this annotation which will activate. * * @param quadPoints an array representing the set of area covered. */ public void setQuadPoints(float[] quadPoints) { COSArray newQuadPoints = new COSArray(); newQuadPoints.setFloatArray(quadPoints); getCOSObject().setItem(COSName.QUADPOINTS, newQuadPoints); }
/** * Check if the Dest element is authorized according to the A entry * * @return if the Dest element is authorized according to the A entry. */ protected boolean checkDest() { try { if (this.pdLink.getDestination() != null && this.pdLink.getAction() != null) { ctx.addValidationError(new ValidationError(ERROR_ANNOT_FORBIDDEN_DEST, "Dest can't be used due to A element")); return false; } COSDictionary dict = pdLink.getCOSObject(); COSBase dest = dict.getDictionaryObject(COSName.DEST); if (dest != null) { ContextHelper.validateElement(ctx, dest, DESTINATION_PROCESS); } } catch (IOException e) { ctx.addValidationError(new ValidationError(ERROR_ANNOT_INVALID_DEST, e.getMessage(), e)); return false; } return true; } }
/** * This will set the border style dictionary, specifying the width and dash pattern used in drawing the line. * * @param bs the border style dictionary to set. * */ public void setBorderStyle(PDBorderStyleDictionary bs) { this.getCOSObject().setItem(COSName.BS, bs); }
/** * This will set the previous URI action, in case it needs to be retrieved at later date. * * @param pa The previous URI. */ public void setPreviousURI(PDActionURI pa) { getCOSObject().setItem("PA", pa); }
/** * Set the annotation action. Either this or the destination entry should be set, but not both. * * @param action The annotation action. * */ public void setAction(PDAction action) { this.getCOSObject().setItem(COSName.A, action); }
/** * The new destination value. Either this or the action entry should be set, but not both. * * @param dest The updated destination. */ public void setDestination(PDDestination dest) { getCOSObject().setItem(COSName.DEST, dest); }
/** * Set the highlight mode. See the HIGHLIGHT_MODE_XXX constants. * * @param mode The new highlight mode. */ public void setHighlightMode(String mode) { getCOSObject().setName(COSName.H, mode); }
/** * This will set the set of quadpoints which encompass the areas of this annotation which will activate. * * @param quadPoints an array representing the set of area covered. */ public void setQuadPoints(float[] quadPoints) { COSArray newQuadPoints = new COSArray(); newQuadPoints.setFloatArray(quadPoints); getCOSObject().setItem(COSName.QUADPOINTS, newQuadPoints); }