// Create 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 the PDF document. documentProperties.setTitle("Document Info Sample"); //Set the PDF version. documentProperties.setPdfVersion(1.5f); //Set the subject of the PDF document. documentProperties.setSubject("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("Creator"); //Set the name of the application that created the PDF document. documentProperties.setProducer("Producer"); PdfSaveOptions pdfSaveOptions = new PdfSaveOptions(); //Sets the document properties of the pdf. pdfSaveOptions.setDocumentProperties(documentProperties); //Save the workbook into pdf file. workbook.save(outputStream, pdfSaveOptions); // Close the file stream try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); }