You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ss...@apache.org on 2014/09/12 15:18:51 UTC

svn commit: r1624539 - /xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter.java

Author: ssteiner
Date: Fri Sep 12 13:18:51 2014
New Revision: 1624539

URL: http://svn.apache.org/r1624539
Log:
FOP-2411: PDF to PDF Link not working

Modified:
    xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter.java

Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter.java?rev=1624539&r1=1624538&r2=1624539&view=diff
==============================================================================
--- xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter.java (original)
+++ xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter.java Fri Sep 12 13:18:51 2014
@@ -1725,16 +1725,19 @@ public class PDFBoxAdapter {
     }
 
     private void updateAnnotationLink(PDFDictionary clonedAnnot) {
-        PDFDictionary a = (PDFDictionary) clonedAnnot.get("A");
-        if (a != null) {
-            PDFArray oldarray = (PDFArray) a.get("D");
-            if (oldarray != null) {
-                PDFArray newarray = (PDFArray) oldarray.get(0);
-                if (newarray != null) {
+        Object a = clonedAnnot.get("A");
+        if (a instanceof PDFDictionary) {
+            PDFDictionary annot = (PDFDictionary) a;
+            Object oldarrayObj = annot.get("D");
+            if (oldarrayObj instanceof PDFArray) {
+                PDFArray oldarray = (PDFArray) oldarrayObj;
+                Object newarrayObj = oldarray.get(0);
+                if (newarrayObj instanceof PDFArray) {
+                    PDFArray newarray = (PDFArray) newarrayObj;
                     for (int i = 1; i < oldarray.length(); i++) {
                         newarray.add(oldarray.get(i));
                     }
-                    a.put("D", oldarray.get(0));
+                    annot.put("D", oldarray.get(0));
                 }
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org