DocumentInfo Class
Contains document properties.
Declaration
public class DocumentInfo extends JavaObject
Remarks
Use the DocumentMetadata.getDocumentInfo() method to access document properties, such as the title, subject, author, keywords, and creator.
The following code snippet loads XMP metadata from an XML file and embeds it into a PDF document:
import com.devexpress.docs.pdf.*;
import java.io.*;
import java.nio.file.*;
public class Main {
public static void main(String[] args) throws Exception {
try (InputStream inputStream = new FileInputStream("Document.pdf");
PdfDocument pdfDocument = new PdfDocument(inputStream);
InputStream metadataStream = new FileInputStream("metadata.xml")) {
pdfDocument.getMetadata().setXmp(
XmpMetadata.fromStream(metadataStream)
);
try (FileOutputStream outputStream = new FileOutputStream("UpdatedDocument.pdf")) {
pdfDocument.save(outputStream);
}
}
}
}
Refer to the following help topic for additional information: Manage PDF Document Properties and XMP Metadata.
Inherited Members
Inheritance
DocumentInfo()
Initializes a new instance of the DocumentInfo class.
Declaration
public DocumentInfo()
Methods
getAuthor() Method
Returns the document author.
Declaration
public String getAuthor()
Returns
| Type | Description |
|---|---|
| String | The document author. |
getCreatedAt() Method
Returns document creation date and time.
Declaration
public OffsetDateTime getCreatedAt()
Returns
| Type | Description |
|---|---|
| OffsetDateTime | Document creation date and time. |
getCreator() Method
Returns the name of the application that created the document.
Declaration
public String getCreator()
Returns
| Type | Description |
|---|---|
| String | The name of the application that created the document. |
getCustomProperties() Method
Returns custom document properties.
Declaration
public Map<String,String> getCustomProperties()
Returns
| Type | Description |
|---|---|
| java.util.Map<java.lang.String,java.lang.String> | Custom document properties. |
Remarks
The getCustomProperties() method returns custom document properties as a Map<String, String>. Add, modify, or remove entries in the returned map to manage custom properties.
getKeywords() Method
Returns document keywords.
Declaration
public String getKeywords()
Returns
| Type | Description |
|---|---|
| String | Document keywords. |
getModifiedAt() Method
Returns document modification date and time.
Declaration
public OffsetDateTime getModifiedAt()
Returns
| Type | Description |
|---|---|
| OffsetDateTime | Document modification date and time. |
getProducer() Method
Returns the name of the application that produced the document.
Declaration
public String getProducer()
Returns
| Type | Description |
|---|---|
| String | The name of the application that produced the document. |
getSubject() Method
Returns the document subject.
Declaration
public String getSubject()
Returns
| Type | Description |
|---|---|
| String | The document subject. |
getTitle() Method
Returns the document title.
Declaration
public String getTitle()
Returns
| Type | Description |
|---|---|
| String | The document title. |
getVersion() Method
Returns the PDF file version specified in the document metadata.
Declaration
public PdfFileVersion getVersion()
Returns
| Type | Description |
|---|---|
| com.devexpress.pdf.PdfFileVersion | The PDF file version. |
setAuthor(String value) Method
Sets the document author.
Declaration
public void setAuthor(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The document author. |
setCreatedAt(OffsetDateTime value) Method
Sets document creation date and time.
Declaration
public void setCreatedAt(OffsetDateTime value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | OffsetDateTime | Document creation date and time. |
setCreator(String value) Method
Sets the name of the application that created the document.
Declaration
public void setCreator(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The name of the application that created the document. |
setKeywords(String value) Method
Sets document keywords.
Declaration
public void setKeywords(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | Document keywords. |
setModifiedAt(OffsetDateTime value) Method
Sets document modification date and time.
Declaration
public void setModifiedAt(OffsetDateTime value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | OffsetDateTime | Document modification date and time. |
setProducer(String value) Method
Sets the name of the application that produced the document.
Declaration
public void setProducer(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The name of the application that produced the document. |
setSubject(String value) Method
Sets the document subject.
Declaration
public void setSubject(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The document subject. |
setTitle(String value) Method
Sets the document title.
Declaration
public void setTitle(String value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The document title. |
setVersion(PdfFileVersion value) Method
Sets the PDF file version.
Declaration
public void setVersion(PdfFileVersion value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | com.devexpress.pdf.PdfFileVersion | The PDF file version. |