Package org.apache.fop.pdf
Class PDFInfo
- java.lang.Object
-
- org.apache.fop.pdf.PDFObject
-
- org.apache.fop.pdf.PDFInfo
-
- All Implemented Interfaces:
PDFWritable
public class PDFInfo extends PDFObject
class representing an /Info object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PDFInfo.StandardKey
The standard keys in the Document Information Dictionary
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
author
private java.util.Date
creationDate
private java.lang.String
creator
the name of the application that created the original document before converting to PDFprivate java.util.Map<PDFName,java.lang.String>
customProperties
private java.lang.String
keywords
private java.util.Date
modDate
private java.lang.String
producer
the application producing the PDFprivate java.lang.String
subject
private java.lang.String
title
-
Constructor Summary
Constructors Constructor Description PDFInfo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.lang.String
formatDateTime(java.util.Date time)
Formats a date/time according to the PDF specification.protected static java.lang.String
formatDateTime(java.util.Date time, java.util.TimeZone tz)
Formats a date/time according to the PDF specification (D:YYYYMMDDHHmmSSOHH'mm').java.lang.String
getAuthor()
java.util.Date
getCreationDate()
java.lang.String
getCreator()
java.lang.String
getKeywords()
java.util.Date
getModDate()
java.lang.String
getProducer()
java.lang.String
getSubject()
java.lang.String
getTitle()
void
put(java.lang.String key, java.lang.String value)
Adds a custom property to this Info dictionary.void
setAuthor(java.lang.String a)
set the author stringvoid
setCreationDate(java.util.Date date)
void
setCreator(java.lang.String creator)
set the creator stringvoid
setKeywords(java.lang.String k)
set the keywords stringvoid
setModDate(java.util.Date date)
Sets the date of the last modification.void
setProducer(java.lang.String producer)
set the producer stringvoid
setSubject(java.lang.String s)
set the subject stringvoid
setTitle(java.lang.String t)
set the title stringbyte[]
toPDF()
Encodes the object as a byte array for output to a PDF file.-
Methods inherited from class org.apache.fop.pdf.PDFObject
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getChildren, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDFString
-
-
-
-
Field Detail
-
producer
private java.lang.String producer
the application producing the PDF
-
title
private java.lang.String title
-
author
private java.lang.String author
-
subject
private java.lang.String subject
-
keywords
private java.lang.String keywords
-
creationDate
private java.util.Date creationDate
-
modDate
private java.util.Date modDate
-
customProperties
private java.util.Map<PDFName,java.lang.String> customProperties
-
creator
private java.lang.String creator
the name of the application that created the original document before converting to PDF
-
-
Method Detail
-
getProducer
public java.lang.String getProducer()
- Returns:
- the producer of the document or null if not set
-
setProducer
public void setProducer(java.lang.String producer)
set the producer string- Parameters:
producer
- the producer string
-
getCreator
public java.lang.String getCreator()
- Returns:
- the creator of the document or null if not set
-
setCreator
public void setCreator(java.lang.String creator)
set the creator string- Parameters:
creator
- the document creator
-
getTitle
public java.lang.String getTitle()
- Returns:
- the title string
-
setTitle
public void setTitle(java.lang.String t)
set the title string- Parameters:
t
- the document title
-
getAuthor
public java.lang.String getAuthor()
- Returns:
- the author of the document or null if not set
-
setAuthor
public void setAuthor(java.lang.String a)
set the author string- Parameters:
a
- the document author
-
getSubject
public java.lang.String getSubject()
- Returns:
- the subject of the document or null if not set
-
setSubject
public void setSubject(java.lang.String s)
set the subject string- Parameters:
s
- the document subject
-
getKeywords
public java.lang.String getKeywords()
- Returns:
- the keywords for the document or null if not set
-
setKeywords
public void setKeywords(java.lang.String k)
set the keywords string- Parameters:
k
- the keywords for this document
-
getCreationDate
public java.util.Date getCreationDate()
- Returns:
- last set creation date
-
setCreationDate
public void setCreationDate(java.util.Date date)
- Parameters:
date
- Date to store in the PDF as creation date. Use null to force current system date.
-
getModDate
public java.util.Date getModDate()
- Returns:
- last modification date
-
setModDate
public void setModDate(java.util.Date date)
Sets the date of the last modification.- Parameters:
date
- the last modification date or null if there are no modifications
-
toPDF
public byte[] toPDF()
Encodes the object as a byte array for output to a PDF file.
-
formatDateTime
protected static java.lang.String formatDateTime(java.util.Date time, java.util.TimeZone tz)
Formats a date/time according to the PDF specification (D:YYYYMMDDHHmmSSOHH'mm').- Parameters:
time
- date/time value to formattz
- the time zone- Returns:
- the requested String representation
-
formatDateTime
protected static java.lang.String formatDateTime(java.util.Date time)
Formats a date/time according to the PDF specification. (D:YYYYMMDDHHmmSSOHH'mm').- Parameters:
time
- date/time value to format- Returns:
- the requested String representation
-
put
public void put(java.lang.String key, java.lang.String value)
Adds a custom property to this Info dictionary.
-
-