From 89ab3a2a903d89ca70ddcc950495305c7309846f Mon Sep 17 00:00:00 2001 From: Joerg Pietschmann Date: Fri, 19 Sep 2003 14:33:16 +0000 Subject: 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 --- src/java/org/apache/fop/pdf/PDFInfo.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/java/org/apache/fop/pdf') 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 @@ -130,6 +131,20 @@ public class PDFInfo extends PDFObject { this.keywords = k; } + /** + * @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() */ @@ -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(); } + } -- cgit v1.2.3