public abstract class DocumentInfo extends Object
Modifier and Type | Field and Description |
---|---|
static String |
KEY_AUTHOR |
static String |
KEY_CREATIONDATE |
static String |
KEY_CREATOR |
static String |
KEY_KEYWORDS |
static String |
KEY_MODDATE |
static String |
KEY_PRODUCER |
static String |
KEY_SUBJECT |
static String |
KEY_TITLE |
static String |
KEY_TRAPPED |
Constructor and Description |
---|
DocumentInfo() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getAuthor()
Returns the document's author.
|
abstract String |
getAuthorTitle()
Returns the document's author-title.
|
abstract String |
getCopyrightInfoURL()
Returns the document's copyright info url.
|
abstract String |
getCopyrightNotice()
Returns the document's copyright notice.
|
abstract String |
getCopyrightStatus()
Returns the document's copyrights status.
|
abstract Date |
getCreationDate()
Returns the document's creation date.
|
abstract String |
getCreator()
Returns the document's creator.
|
abstract String |
getCustomProperty(String key)
Returns the value of a custom property.
|
abstract String |
getDescriptionWriter()
Returns the document's description writer.
|
static DocumentInfo |
getDocumentInfo(InputStream inStream,
IPassword password)
Static method to get the document information from a document from an InputStream.
|
static DocumentInfo |
getDocumentInfo(String fileName,
IPassword passwords)
Static method to get the document information from a document in a file.
|
static DocumentInfo |
getDocumentInfo(URL url,
IPassword password)
Static method to get the document information from a document from a URL.
|
abstract String |
getKeywords()
Returns the document's keywords.
|
abstract Date |
getModDate()
Returns the document's modified date.
|
abstract int |
getPageCount()
Gets the number of pages in the document.
|
abstract String |
getProducer()
Returns the document's producer.
|
abstract String |
getSubject()
Returns the document's subject.
|
abstract String |
getTitle()
Gets the document's title.
|
abstract String |
getTrapped()
Returns string indicating if the document has been modified with trapping information.
|
abstract byte[] |
getXMPMetadata()
Returns the raw XMP metadata in the document as an array of bytes.
|
abstract String |
getXMPMetadata(String charsetName)
Returns the XMP metadata in the document.
|
abstract void |
setAuthor(String author)
Set the document's author.
|
abstract void |
setAuthorTitle(String authorTitle)
Set the document's author-title.
|
abstract void |
setCopyrightInfoURL(String copyrightURL)
Set the document's copyright info url.
|
abstract void |
setCopyrightNotice(String copyrightNotice)
Set the document's copyright notice.
|
abstract void |
setCopyrightStatus(String copyrightStatus)
Set the document's copyrights status.
|
abstract void |
setCreationDate(Date creationDate)
Set the document's creation date.
|
abstract void |
setCreator(String creator)
Set the document's creator.
|
abstract void |
setCustomProperty(String key,
String value)
Sets a custom application property in the document info for the document.
|
abstract void |
setDescriptionWriter(String descriptionWriter)
Set the document's description writer.
|
abstract void |
setKeywords(String keywords)
Set the document's keywords.
|
abstract void |
setModifiedDate(Date modDate)
Deprecated.
The document's modified date will be set by the library at the time the document is saved.
|
abstract void |
setProducer(String producer)
Set the document's producer.
|
abstract void |
setSubject(String subject)
Set the document's subject.
|
abstract void |
setTitle(String title)
Sets the document's title.
|
abstract void |
setXMPMetadata(byte[] xmpData)
Sets the XMP metadata block in the document.
|
abstract void |
setXMPMetadata(String xmpString,
String charsetName)
Sets the XMP metadata block in the document.
|
public static final String KEY_TITLE
public static final String KEY_AUTHOR
public static final String KEY_SUBJECT
public static final String KEY_KEYWORDS
public static final String KEY_CREATOR
public static final String KEY_PRODUCER
public static final String KEY_TRAPPED
public static final String KEY_CREATIONDATE
public static final String KEY_MODDATE
public static DocumentInfo getDocumentInfo(String fileName, IPassword passwords) throws PDFException
fileName
- The name of the file.passwords
- An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword
class that can hold a single
password or a list of passwords.PDFException
- Thrown when any error occurs when getting the document info from the PDF document.public static DocumentInfo getDocumentInfo(InputStream inStream, IPassword password) throws PDFException
inStream
- InputStream that will be used to read the PDF document.password
- An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword
class that can hold a single
password or a list of passwords.PDFException
- Thrown when any error occurs when getting the document info from the PDF document.public static DocumentInfo getDocumentInfo(URL url, IPassword password) throws PDFException
url
- The url where the PDF document can be found.password
- An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword
class that can hold a single
password or a list of passwords.PDFException
- Thrown when any error occurs when getting the document info from the PDF document.public abstract String getTitle()
public abstract void setTitle(String title) throws PDFException
title
- The document's title.PDFException
- Thrown when any error occurs when setting the title property inside the PDF.public abstract String getAuthor()
public abstract String getSubject()
public abstract String getKeywords()
public abstract String getCreator()
public abstract String getProducer()
public abstract String getTrapped()
public abstract Date getCreationDate()
public abstract Date getModDate()
public abstract int getPageCount()
public abstract void setAuthor(String author) throws PDFException
author
- The document's author.PDFException
- Thrown when any error occurs when setting the author property inside the PDF.public abstract void setCreationDate(Date creationDate) throws PDFException
creationDate
- The document's creation date.PDFException
- Thrown when any error occurs when setting the creation date property inside the PDF.public abstract void setCreator(String creator) throws PDFException
creator
- The document's creator.PDFException
- Thrown when any error occurs when setting the creator property inside the PDF.public abstract void setKeywords(String keywords) throws PDFException
keywords
- The document's keywords.PDFException
- Thrown when any error occurs when setting the keywords property inside the PDF.public abstract void setModifiedDate(Date modDate) throws PDFException
modDate
- The document's modified date.PDFException
- Thrown when any error occurs when setting the modified date property inside the PDF.public abstract void setProducer(String producer) throws PDFException
producer
- The document's producer.PDFException
- Thrown when any error occurs when setting the producer property inside the PDF.public abstract void setSubject(String subject) throws PDFException
subject
- The document's subject.PDFException
- Thrown when any error occurs when setting the subject inside the PDF.public abstract String getXMPMetadata(String charsetName) throws UnsupportedEncodingException
charsetName
- The name of the character set to use when decoding the XMP data stream. Every implementation
of Java is supposed to support US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE and UTF-16UnsupportedEncodingException
- Thrown if the character set name specified is not available in this JVM.public abstract void setXMPMetadata(String xmpString, String charsetName) throws PDFException, UnsupportedEncodingException
xmpString
- The new XMP block.charsetName
- The name of the character set to use when encoding the XMP string to bytes. Every implementation
of Java is supposed to support US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE and UTF-16xmpString
- The new XMP metadata. The new data will replace any existing XMP metadata if there is any.charsetName
- The character set to use when writing the XMP metadata to the PDF file.PDFException
- Thrown when any error occurs when setting the XMP metadata inside the PDF.UnsupportedEncodingException
- Thrown if the character set name specified is not available in this JVM.public abstract void setXMPMetadata(byte[] xmpData) throws PDFException
xmpData
- The new XMP metadata. The new data will replace any existing XMP metadata if there is any.PDFException
- Thrown when any error occurs when setting the XMP metadata inside the PDF.public abstract byte[] getXMPMetadata()
public abstract void setCustomProperty(String key, String value) throws PDFException
key
- The property key or namevalue
- The value of the property.PDFException
- Thrown when any error occurs when setting the custom property inside the PDF.public abstract String getCustomProperty(String key)
key
- The name of the propertypublic abstract void setAuthorTitle(String authorTitle)
authorTitle
- The document's author-title.public abstract String getAuthorTitle()
public abstract void setDescriptionWriter(String descriptionWriter)
descriptionWriter
- The document's description writer.public abstract String getDescriptionWriter()
public abstract void setCopyrightStatus(String copyrightStatus)
copyrightStatus
- The document's copyrights status.public abstract String getCopyrightStatus()
public abstract void setCopyrightInfoURL(String copyrightURL)
copyrightURL
- The document's copyright info url.public abstract String getCopyrightInfoURL()
public abstract void setCopyrightNotice(String copyrightNotice)
copyrightNotice
- The document's copyright notice.public abstract String getCopyrightNotice()