aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/pdf
diff options
context:
space:
mode:
authorJoerg Pietschmann <pietsch@apache.org>2003-09-19 14:33:16 +0000
committerJoerg Pietschmann <pietsch@apache.org>2003-09-19 14:33:16 +0000
commit89ab3a2a903d89ca70ddcc950495305c7309846f (patch)
tree419339e1b21dcce727439eea7bc5b3fc83f1de4b /src/java/org/apache/fop/pdf
parentccec697126aed2004e7566c599a243701d0cc41a (diff)
downloadxmlgraphics-fop-89ab3a2a903d89ca70ddcc950495305c7309846f.tar.gz
xmlgraphics-fop-89ab3a2a903d89ca70ddcc950495305c7309846f.zip
Organize imports.
A bit of JavaDoc cosmetics. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196923 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/pdf')
-rw-r--r--src/java/org/apache/fop/pdf/PDFInfo.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFInfo.java b/src/java/org/apache/fop/pdf/PDFInfo.java
index 01b443370..3894b1bcf 100644
--- a/src/java/org/apache/fop/pdf/PDFInfo.java
+++ b/src/java/org/apache/fop/pdf/PDFInfo.java
@@ -69,6 +69,7 @@ public class PDFInfo extends PDFObject {
private String author = null;
private String subject = null;
private String keywords = null;
+ private Date creationDate = null;
/**
* the name of the application that created the
@@ -131,6 +132,20 @@ public class PDFInfo extends PDFObject {
}
/**
+ * @return last set creation date
+ */
+ public Date getCreationDate() {
+ return creationDate;
+ }
+
+ /**
+ * @param date Date to store in the PDF as creation date. Use null to force current system date.
+ */
+ public void setCreationDate(Date date) {
+ creationDate = date;
+ }
+
+ /**
* @see org.apache.fop.pdf.PDFObject#toPDF()
*/
public byte[] toPDF() {
@@ -170,9 +185,11 @@ public class PDFInfo extends PDFObject {
bout.write(encode("\n"));
// creation date in form (D:YYYYMMDDHHmmSSOHH'mm')
- final Date date = new Date();
+ if(creationDate==null) {
+ creationDate = new Date();
+ }
final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
- final String str = sdf.format(date) + "+00'00'";
+ final String str = sdf.format(creationDate) + "+00'00'";
bout.write(encode("/CreationDate "));
bout.write(encodeString("D:" + str));
bout.write(encode("\n>>\nendobj\n"));
@@ -181,5 +198,6 @@ public class PDFInfo extends PDFObject {
}
return bout.toByteArray();
}
+
}