[]
Use this class to define PDF metadata such as the title, author, subject, keywords, creator, producer, creation date, modification date, and the PDF version to use when generating the document. Assign an instance to PdfSaveOptions.setDocumentProperties(DocumentProperties) to apply these properties during PDF export.
Workbook workbook = new Workbook();
IWorksheet worksheet = workbook.getWorksheets().get(0);
worksheet.getRange("A1").setValue("Quarterly Sales Summary");
DocumentProperties documentProperties = new DocumentProperties();
documentProperties.setTitle("Quarterly Sales Summary");
documentProperties.setAuthor("Author");
documentProperties.setPdfVersion(1.5f);
PdfSaveOptions options = new PdfSaveOptions();
options.setDocumentProperties(documentProperties);
String fileName = "DocumentProperties.pdf";
workbook.save(fileName, options);
floatgetTitle()voidvoidsetCreationDate(Calendar value) voidsetCreator(String value) voidsetKeywords(String value) voidsetModifyDate(Calendar value) voidsetPdfVersion(float value) voidsetProducer(String value) voidsetSubject(String value) voidtoString()This value specifies the PDF version that is used when generating the document.
DocumentProperties properties = new DocumentProperties();
properties.setPdfVersion(1.4f);
float pdfVersion = properties.getPdfVersion();
This value specifies the PDF version that is used when generating the document.
DocumentProperties properties = new DocumentProperties();
properties.setPdfVersion(1.4f);
value - The PDF version of the generated document.This property specifies the title stored in the document properties.
DocumentProperties properties = new DocumentProperties();
properties.setTitle("Quarterly Sales Summary");
String title = properties.getTitle();
This property specifies the title stored in the document properties.
DocumentProperties properties = new DocumentProperties();
properties.setTitle("Quarterly Sales Summary");
value - The title of the document.
DocumentProperties properties = new DocumentProperties();
properties.setAuthor("Author");
String author = properties.getAuthor();
null if no author has been set.
DocumentProperties properties = new DocumentProperties();
properties.setAuthor("Author");
value - The name of the person that created the document. Sets null if no author has been set.Use this property to retrieve the subject metadata associated with the document.
DocumentProperties properties = new DocumentProperties();
properties.setSubject("Quarterly Sales Summary");
String subject = properties.getSubject();
Use this property to set the subject metadata associated with the document.
DocumentProperties properties = new DocumentProperties();
properties.setSubject("Quarterly Sales Summary");
value - The subject of the document.The returned string contains the document keywords as a comma-separated list.
DocumentProperties properties = new DocumentProperties();
properties.setKeywords("report, sales, quarterly");
String keywords = properties.getKeywords();
null if no keywords have been set.The returned string contains the document keywords as a comma-separated list.
DocumentProperties properties = new DocumentProperties();
properties.setKeywords("report, sales, quarterly");
value - The comma-separated keywords associated with the document, or null if no keywords have been set.This value represents the original document or application creator. It is distinct from getProducer(), which identifies the application or library that produced the PDF document.
DocumentProperties properties = new DocumentProperties();
properties.setCreator("Report Designer");
String creator = properties.getCreator();
null if it has not been set.This value represents the original document or application creator. It is distinct from getProducer(), which identifies the application or library that produced the PDF document.
DocumentProperties properties = new DocumentProperties();
properties.setCreator("Report Designer");
value - The name of the application that created the original document, or null if it has not been set.This value represents the PDF producer or exporter and is distinct from getCreator(), which identifies the original document or application creator.
DocumentProperties properties = new DocumentProperties();
properties.setProducer("PDF Exporter");
String producer = properties.getProducer();
null if no producer has been set.This value represents the PDF producer or exporter and is distinct from getCreator(), which identifies the original document or application creator.
DocumentProperties properties = new DocumentProperties();
properties.setProducer("PDF Exporter");
value - The name of the application or library that produced the PDF document. Sets null if no producer has been set.Use this method to retrieve the value previously assigned by setCreationDate(Calendar) for PDF document properties.
DocumentProperties properties = new DocumentProperties();
properties.setCreationDate(new GregorianCalendar(2019, 5, 24));
Calendar creationDate = properties.getCreationDate();
null if no creation date has been set.Use this method to assign the creation timestamp stored in the document properties.
DocumentProperties properties = new DocumentProperties();
Calendar creationDate = new GregorianCalendar(2024, 2, 15, 10, 30, 0);
properties.setCreationDate(creationDate);
value - The creation date and time to set. This value can be null.Use this method to retrieve the modification timestamp stored in this DocumentProperties instance.
DocumentProperties properties = new DocumentProperties();
properties.setModifyDate(new GregorianCalendar(2020, 5, 24));
Calendar modifyDate = properties.getModifyDate();
null if no modify date has been set.Use this property to store the modification timestamp in the PDF document properties. Passing null clears the stored modification date.
DocumentProperties properties = new DocumentProperties();
properties.setCreationDate(new GregorianCalendar(2019, 5, 24));
properties.setModifyDate(new GregorianCalendar(2020, 5, 24));
value - The modification date and time to set. null clears the stored modification date.