Hi,
We are trying to updating the properties of a PDF file in PDFs created with older version of Aspose.
A copy of the file is made, but the properties itself aren’t changed.
We are using the Aspose Java 20.6 version.
See settings in the original PDF:
setting2.png (51.6 KB)
pdfsetting1.png (52.3 KB)
The PDf were made with Aspose .NET 17.6
Some code snippets:
Document pdfDocument = null;
try {
pdfDocument = new Document(importfile );
com.aspose.pdf.DocumentInfo docInfo = pdfDocument.getInfo();
// set Author information
docInfo.setAuthor("Backbook Migration");
docInfo.setCreationDate(new java.util.Date());
docInfo.setKeywords(referenceRate);
docInfo.setModDate(new java.util.Date());
docInfo.setSubject("Proposal");
docInfo.setTitle("Company Contract 1234-3333");
System.out.println("Adding metadata");
} catch (Exception e)
{
logger.error("Error adding information to PDF");
}
try {
logger.debug("Repairing PDF");
pdfDocument.repair();
logger.debug("Finished Repairing PDF");
} catch (Exception e)
{
logger.error("Error repairing file.. Error "+ e.getMessage());
}
try {
System.out.println("Saving PDF");
pdfDocument.save(exportdir+"/company"+companyname()+".pdf");;
System.out.println("Finished saving pdf");
} catch (Exception e)
{
logger.error("Error saving file.. Error "+ e.getMessage());
}