# Support Document Properties

With DsExcel, you can store useful document information while saving Excel spreadsheets to PDF documents such as title, author, etc.

## Content

DsExcel provides support for document properties while saving Excel spreadsheets to PDF documents. The document properties contain the basic information about a document, such as title, author, creation date, subject, creator, version etc. You can store such useful information in the exported PDF document.
The [DocumentProperties](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html) class contains the methods such as [setPdfVersion](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html#setPdfVersion), [setTitle](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html#setTitle), [setAuthor](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html#setAuthor), [setSubject](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html#setSubject), [setKeywords](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html#setKeywords), [setCreator](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html#setCreator), [setProducer](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html#setProducer), [setCreationDate](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html#setCreationDate) and [setModifyDate](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/DocumentProperties.html#setModifyDate).

## Using Code

Refer to the following example code to add document properties in the exported PDF document.

```Java
//create to a pdf file stream
FileOutputStream outputStream = null;
try {
    outputStream = new FileOutputStream("SetDocumentPropertiesToPDF.pdf");
} catch (FileNotFoundException e) {
    e.printStackTrace();
}
//create a new workbook
Workbook workbook = new Workbook();

IWorksheet worksheet = workbook.getWorksheets().get(0);
worksheet.getRange("A1").setValue("Document Solutions for Excel");
worksheet.getRange("A1").getFont().setSize(25);

DocumentProperties documentProperties = new DocumentProperties();
//Sets the name of the person that created the PDF document.
documentProperties.setAuthor("Jaime Smith");
//Sets the title of thePDF document.
documentProperties.setTitle("DsPdf Document Info Sample");
//Set the PDF version.
documentProperties.setPdfVersion(1.5f);
//Set the subject of the PDF document.
documentProperties.setSubject("DsPdfDocument.DocumentInfo");
//Set the keyword associated with the PDF document.
documentProperties.setKeywords("Keyword1");
//Set the creation date and time of the PDF document.
documentProperties.setCreationDate(new GregorianCalendar(2019,5,24));
//Set the date and time the PDF document was most recently modified.
documentProperties.setModifyDate(new GregorianCalendar(2020,5,24));
//Set the name of the application that created the original PDF document.
documentProperties.setCreator("DsPdfWeb Creator");
//Set the name of the application that created the PDF document.
documentProperties.setProducer("DsPdfWeb Producer");


PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
//Sets the document properties of the pdf.
pdfSaveOptions.setDocumentProperties(documentProperties);
```