pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1715924 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
Date Mon, 23 Nov 2015 19:16:33 GMT
Author: tilman
Date: Mon Nov 23 19:16:33 2015
New Revision: 1715924

URL: http://svn.apache.org/viewvc?rev=1715924&view=rev
Log:
PDFBOX-1621: improve javadoc and add Calendar-based method for setModifiedDate(), as proposed
by Gilad Denneboom and Maciej Wo?niak

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

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java?rev=1715924&r1=1715923&r2=1715924&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
Mon Nov 23 19:16:33 2015
@@ -17,6 +17,7 @@
 package org.apache.pdfbox.pdmodel.interactive.annotation;
 
 import java.io.IOException;
+import java.util.Calendar;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -539,9 +540,13 @@ public abstract class PDAnnotation imple
     }
 
     /**
-     * This will set the the date and time the annotation was modified.
-     * 
-     * @param m the date and time the annotation was created.
+     * This will set the date and time the annotation was modified.
+     *
+     * @param m the date and time the annotation was created. Date values used in a PDF shall
+     * conform to a standard date format, which closely follows that of the international
standard
+     * ASN.1 (Abstract Syntax Notation One), defined in ISO/IEC 8824. A date shall be a text
string
+     * of the form (D:YYYYMMDDHHmmSSOHH'mm). Alternatively, use
+     * {@link #setModifiedDate(java.util.Calendar)}
      */
     public void setModifiedDate(String m)
     {
@@ -549,6 +554,16 @@ public abstract class PDAnnotation imple
     }
 
     /**
+     * This will set the date and time the annotation was modified.
+     *
+     * @param c the date and time the annotation was created.
+     */
+    public void setModifiedDate(Calendar c)
+    {
+        getDictionary().setDate(COSName.M, c);
+    }
+
+    /**
      * This will get the name, a string intended to uniquely identify each annotation within
a page. Not to be confused
      * with some annotations Name entry which impact the default image drawn for them.
      * 



Mime
View raw message