pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1674234 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf: FDFAnnotation.java FDFAnnotationLink.java FDFDictionary.java
Date Fri, 17 Apr 2015 08:37:08 GMT
Author: msahyoun
Date: Fri Apr 17 08:37:08 2015
New Revision: 1674234

URL: http://svn.apache.org/r1674234
Log:
PDFBOX-2758 add Link annotation to FDF

Added:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLink.java
  (with props)
Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFDictionary.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java?rev=1674234&r1=1674233&r2=1674234&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java Fri
Apr 17 08:37:08 2015
@@ -205,6 +205,10 @@ public abstract class FDFAnnotation impl
             {
                 retval = new FDFAnnotationLine(fdfDic);
             }
+            else if (FDFAnnotationLink.SUBTYPE.equals(fdfDic.getNameAsString(COSName.SUBTYPE)))
+            {
+                retval = new FDFAnnotationLink(fdfDic);
+            }
             else if (FDFAnnotationCircle.SUBTYPE.equals(fdfDic.getNameAsString(COSName.SUBTYPE)))
             {
                 retval = new FDFAnnotationCircle(fdfDic);

Added: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLink.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLink.java?rev=1674234&view=auto
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLink.java
(added)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLink.java
Fri Apr 17 08:37:08 2015
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pdfbox.pdmodel.fdf;
+
+import java.io.IOException;
+
+import org.apache.pdfbox.cos.COSDictionary;
+import org.apache.pdfbox.cos.COSName;
+import org.w3c.dom.Element;
+
+public class FDFAnnotationLink extends FDFAnnotation
+{
+    /**
+     * COS Model value for SubType entry.
+     */
+    public static final String SUBTYPE ="Link";
+
+    /**
+     * Default constructor.
+     */
+    public FDFAnnotationLink()
+    {
+        super();
+        annot.setName( COSName.SUBTYPE, SUBTYPE );
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param a An existing FDF Annotation.
+     */
+    public FDFAnnotationLink( COSDictionary a )
+    {
+        super( a );
+    }
+
+    /**
+     * Constructor.
+     *
+     *  @param element An XFDF element.
+     *
+     *  @throws IOException If there is an error extracting information from the element.
+     */
+    public FDFAnnotationLink( Element element ) throws IOException
+    {
+        super( element );
+        annot.setName( COSName.SUBTYPE, SUBTYPE );
+    }
+}

Propchange: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLink.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLink.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFDictionary.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFDictionary.java?rev=1674234&r1=1674233&r2=1674234&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFDictionary.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFDictionary.java Fri
Apr 17 08:37:08 2015
@@ -156,7 +156,7 @@ public class FDFDictionary implements CO
                             }
                             else if (annotationName.equals("link"))
                             {
-                                // TODO: support link annotation
+                                annotList.add(new FDFAnnotationLink(annot));
                             }
                             else if (annotationName.equals("circle"))
                             {



Mime
View raw message