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 issue 517 #518

Merged
merged 16 commits into from
Apr 22, 2021
4 changes: 2 additions & 2 deletions openpdf/src/main/java/com/lowagie/text/pdf/PageResources.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ PdfDictionary getResources() {
PdfResources resources = new PdfResources();
if (originalResources != null)
resources.putAll(originalResources);
resources.put(PdfName.PROCSET, new PdfLiteral("[/PDF /Text /ImageB /ImageC /ImageI]"));
//resources.put(PdfName.PROCSET, new PdfLiteral("[/PDF /Text /ImageB /ImageC /ImageI]"));
resources.add(PdfName.FONT, fontDictionary);
resources.add(PdfName.XOBJECT, xObjectDictionary);
resources.add(PdfName.COLORSPACE, colorDictionary);
Expand All @@ -185,4 +185,4 @@ boolean hasResources() {
|| extGStateDictionary.size() > 0
|| propertyDictionary.size() > 0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ void testCreatePdfStream() throws DocumentException {
Assertions.assertEquals(header, "%PDF-", "This is no PDF.");
}

}
}
26 changes: 26 additions & 0 deletions openpdf/src/test/java/com/lowagie/text/pdf/table/ProcSetTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.lowagie.text.pdf.table;

import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.pdf.PdfName;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfWriter;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.io.IOException;

public class ProcSetTest {
@Test
public void procSetTest1() throws IOException {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Document document = new Document();
PdfWriter.getInstance(document, stream);
document.open();
document.add(Chunk.NEWLINE);
document.close();
PdfReader reader = new PdfReader(stream.toByteArray());
Assertions.assertNull(reader.getPageN(1).getAsDict(PdfName.RESOURCES).get(PdfName.PROCSET));
}
}