Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #502: Changed constructor for PdfDocument #504

Merged
merged 2 commits into from
Mar 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openpdf/src/main/java/com/lowagie/text/pdf/PdfDocument.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ void setAdditionalActions(PdfDictionary actions) {
*/
public PdfDocument() {
super();
addProducer();
addCreationDate();
}

/** The <CODE>PdfWriter</CODE>. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ private HashMap<String, String> createCleanerMoreInfo() {

@Test
public void testProducer() throws Exception {
String PRODUCER = "OpenPDF 1.3.26-SNAPSHOT";

ByteArrayOutputStream baos = new ByteArrayOutputStream();
Document document = new Document();

Expand All @@ -45,7 +47,7 @@ public void testProducer() throws Exception {
document.close();

try (PdfReader r = new PdfReader(baos.toByteArray())) {
Assertions.assertNull(r.getInfo().get("Producer"));
Assertions.assertEquals(PRODUCER, r.getInfo().get("Producer"));
}

}
Expand Down