You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2015/11/23 20:04:11 UTC
svn commit: r1715917 -
/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
Author: tilman
Date: Mon Nov 23 19:04:10 2015
New Revision: 1715917
URL: http://svn.apache.org/viewvc?rev=1715917&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/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=1715917&r1=1715916&r2=1715917&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 Mon Nov 23 19:04:10 2015
@@ -17,6 +17,8 @@
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;
import org.apache.pdfbox.cos.COSArray;
@@ -558,8 +560,12 @@ public abstract class PDAnnotation imple
/**
* This will set the date and time the annotation was modified.
- *
- * @param m the date and time the annotation was created.
+ *
+ * @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)
{
@@ -567,6 +573,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)
+ {
+ getCOSObject().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.
*