aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/pdf/PDFInfo.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2001-11-12 13:10:12 +0000
committerKeiron Liddle <keiron@apache.org>2001-11-12 13:10:12 +0000
commit364a97a6e14a63a4df36b64d492a26ea59cfa173 (patch)
tree942ed7e3c5f0d0b43a0c6856ea6b548ce130a7fc /src/org/apache/fop/pdf/PDFInfo.java
parent290c33e88a2fbc430d52e3754813e6519193982c (diff)
downloadxmlgraphics-fop-364a97a6e14a63a4df36b64d492a26ea59cfa173.tar.gz
xmlgraphics-fop-364a97a6e14a63a4df36b64d492a26ea59cfa173.zip
some changes for out of order rendering and rendering to a renderer
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194565 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/pdf/PDFInfo.java')
-rw-r--r--src/org/apache/fop/pdf/PDFInfo.java56
1 files changed, 50 insertions, 6 deletions
diff --git a/src/org/apache/fop/pdf/PDFInfo.java b/src/org/apache/fop/pdf/PDFInfo.java
index a8215fcea..bbef7a897 100644
--- a/src/org/apache/fop/pdf/PDFInfo.java
+++ b/src/org/apache/fop/pdf/PDFInfo.java
@@ -7,9 +7,8 @@
package org.apache.fop.pdf;
-// Java
-import java.io.IOException;
-import java.io.PrintWriter;
+import java.util.Date;
+import java.text.SimpleDateFormat;
/**
* class representing an /Info object
@@ -21,6 +20,15 @@ public class PDFInfo extends PDFObject {
*/
protected String producer;
+ protected String title = null;
+ protected String author = null;
+ protected String subject = null;
+ protected String keywords = null;
+
+ // the name of the application that created the
+ // original document before converting to PDF
+ protected String creator;
+
/**
* create an Info object
*
@@ -39,6 +47,22 @@ public class PDFInfo extends PDFObject {
this.producer = producer;
}
+ public void setTitle(String t) {
+ this.title = t;
+ }
+
+ public void setAuthor(String a) {
+ this.author = a;
+ }
+
+ public void setSubject(String s) {
+ this.subject = s;
+ }
+
+ public void setKeywords(String k) {
+ this.keywords = k;
+ }
+
/**
* produce the PDF representation of the object
*
@@ -46,9 +70,29 @@ public class PDFInfo extends PDFObject {
*/
public byte[] toPDF() {
String p = this.number + " " + this.generation
- + " obj\n<< /Type /Info\n/Producer (" + this.producer
- + ") >>\nendobj\n";
+ + " obj\n<< /Type /Info\n";
+ if(title != null) {
+ p += "/Title (" + this.title + ")\n";
+ }
+ if(author != null) {
+ p += "/Author (" + this.author + ")\n";
+ }
+ if(subject != null) {
+ p += "/Subject (" + this.subject + ")\n";
+ }
+ if(keywords != null) {
+ p += "/Keywords (" + this.keywords + ")\n";
+ }
+
+ p += "/Producer (" + this.producer + ")\n";
+
+ // creation date in form (D:YYYYMMDDHHmmSSOHH'mm')
+ Date date = new Date();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmss");
+ String str = sdf.format(date) + "+00'00'";
+ p += "/CreationDate (D:" + str + ")";
+ p += " >>\nendobj\n";
return p.getBytes();
}
-
}
+