pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1717463 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
Date Tue, 01 Dec 2015 16:56:00 GMT
Author: tilman
Date: Tue Dec  1 16:55:59 2015
New Revision: 1717463

URL: http://svn.apache.org/viewvc?rev=1717463&view=rev
Log:
PDFBOX-3141: add getter/setter /Border

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java?rev=1717463&r1=1717462&r2=1717463&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
Tue Dec  1 16:55:59 2015
@@ -24,6 +24,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSDictionary;
+import org.apache.pdfbox.cos.COSInteger;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSNumber;
 import org.apache.pdfbox.pdmodel.PDPage;
@@ -625,6 +626,40 @@ public abstract class PDAnnotation imple
     }
 
     /**
+     * This will retrieve the border array. If none is available, it will return the default,
which
+     * is [0 0 1].
+     *
+     * @return the border array.
+     */
+    public COSArray getBorder()
+    {
+        COSBase base = getCOSObject().getDictionaryObject(COSName.BORDER);
+        COSArray border;
+        if (!(base instanceof COSArray))
+        {
+            border = new COSArray();
+            border.add(COSInteger.ZERO);
+            border.add(COSInteger.ZERO);
+            border.add(COSInteger.ONE);
+        }
+        else
+        {
+            border = (COSArray) base;
+        }
+        return border;
+    }
+    
+    /**
+     * This will set the border array.
+     * 
+     * @param borderArray the border array to set.
+     */
+    public void setBorder(COSArray borderArray)
+    {
+        getCOSObject().setItem(COSName.BORDER, borderArray);
+    }
+    
+    /**
      * This will set the color used in drawing various elements. As of PDF 1.6 these are
: Background of icon when
      * closed Title bar of popup window Border of a link annotation
      * 



Mime
View raw message