After creating or assembling a PDF document, it is a important to set or edit the meta data. Qoppa Java libraries jPDFAssemble and jPDFProcess can edit document properties and xml metadata such as title, author, subject and keywords.

The sample java code below shows how to open a PDF, edit the document properties and then save the document.

// load a PDF
PDFAssemble pdfDoc = new PDFAssemble("C:\\sample.pdf", null);
 
// setting document properties
// document title
pdfDoc.getDocumentInfo().setTitle("My Document Title");
// document author
pdfDoc.getDocumentInfo().setAuthor("My Author");
// document subject
pdfDoc.getDocumentInfo().setSubject("My Subject");
// document keywords (must be separated by commas or semicolons)
pdfDoc.getDocumentInfo().setKeywords("keyword1, keyword2, keyword3, keyword4");
 
// save the PDF
pdfDoc.saveDocument("C:\\sample.pdf");