pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1653977 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox: cos/COSName.java pdmodel/interactive/annotation/PDAnnotationLink.java
Date Thu, 22 Jan 2015 18:05:59 GMT
Author: tilman
Date: Thu Jan 22 18:05:59 2015
New Revision: 1653977

URL: http://svn.apache.org/r1653977
Log:
PDFBOX-2622: allow /BS as indirect object

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java?rev=1653977&r1=1653976&r2=1653977&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java Thu Jan 22 18:05:59
2015
@@ -93,6 +93,7 @@ public final class COSName extends COSBa
     public static final COSName BM = new COSName("BM");
     public static final COSName BOUNDS = new COSName("Bounds");
     public static final COSName BPC = new COSName("BPC");
+    public static final COSName BS = new COSName("BS");
     public static final COSName BYTERANGE = new COSName("ByteRange");
     // C
     public static final COSName C = new COSName("C");

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java?rev=1653977&r1=1653976&r2=1653977&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java
Thu Jan 22 18:05:59 2015
@@ -114,9 +114,9 @@ public class PDAnnotationLink extends PD
      * TODO not all annotations may have a BS entry
      *
      */
-    public void setBorderStyle( PDBorderStyleDictionary bs )
+    public void setBorderStyle(PDBorderStyleDictionary bs)
     {
-        this.getDictionary().setItem( "BS", bs);
+        this.getDictionary().setItem(COSName.BS, bs);
     }
 
     /**
@@ -124,15 +124,13 @@ public class PDAnnotationLink extends PD
      * dash pattern used in drawing the line.
      *
      * @return the border style dictionary.
-     * TODO not all annotations may have a BS entry
      */
     public PDBorderStyleDictionary getBorderStyle()
     {
-        COSDictionary bs = (COSDictionary) this.getDictionary().getItem(
-                COSName.getPDFName( "BS" ) );
-        if (bs != null)
+        COSBase bs = this.getDictionary().getDictionaryObject(COSName.BS);
+        if (bs instanceof COSDictionary)
         {
-            return new PDBorderStyleDictionary( bs );
+            return new PDBorderStyleDictionary((COSDictionary) bs);
         }
         else
         {



Mime
View raw message