PdfDocumentInfo implements Serializable { public String getAuthor() { return getStringValue(PdfName.Author); } PdfDocumentInfo(PdfDictionary pdfObject, PdfDocument pdfDocument);   PdfDocumentInfo(PdfDocument pdfDocument); PdfDocumentInfo setTitle(String title); PdfDocumentInfo setAuthor(String author); PdfDocumentInfo setSubject(String subject); PdfDocumentInfo setKeywords(String keywords); PdfDocumentInfo setCreator(String creator); PdfDocumentInfo setTrapped(PdfName trapped); String getTitle(); String getAuthor(); String getSubject(); String getKeywords(); String getCreator(); String getProducer(); PdfName getTrapped(); PdfDocumentInfo addCreationDate(); PdfDocumentInfo addModDate(); void setMoreInfo(Map<String, String> moreInfo); void setMoreInfo(String key, String value); String getMoreInfo(String key);  }
@Test public void simpleStampingMetadataLeaveUnchanged() throws IOException, InterruptedException { String inputFile = sourceFolder + "cmp_metadata_pdf_20_changed_append.pdf"; String outFile = destinationFolder + "metadata_pdf_20_unchanged_stamper.pdf"; String cmpFile = sourceFolder + "cmp_metadata_pdf_20_changed_append.pdf"; PdfDocument document = new PdfDocument(new PdfReader(inputFile), new PdfWriter(outFile), new StampingProperties()); String author = document.getDocumentInfo().getAuthor(); document.close(); Assert.assertEquals("Author", "Bruno Lowagie; Alexey Subach", author); CompareTool ct = new CompareTool(); Assert.assertNull(ct.compareByContent(outFile, cmpFile, destinationFolder, "diff_")); Assert.assertNull(ct.compareDocumentInfo(outFile, cmpFile)); Assert.assertNull(ct.compareXmp(outFile, cmpFile, true)); }