Skip to content

Commit 10c6311

Browse files
committed
🔨 compress content stream
1 parent 8ea7c89 commit 10c6311

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/com/amastigote/unstamper/core/Processor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.sun.istack.internal.NotNull;
1212
import org.apache.pdfbox.contentstream.operator.Operator;
1313
import org.apache.pdfbox.cos.COSArray;
14+
import org.apache.pdfbox.cos.COSName;
1415
import org.apache.pdfbox.cos.COSString;
1516
import org.apache.pdfbox.pdfparser.PDFStreamParser;
1617
import org.apache.pdfbox.pdfwriter.ContentStreamWriter;
@@ -127,8 +128,9 @@ public static void process(
127128

128129
/* >> write modified tokens back to the stream */
129130
PDStream newContents = new PDStream(pdDocument);
130-
OutputStream out = newContents.createOutputStream();
131+
OutputStream out = newContents.createOutputStream(COSName.FLATE_DECODE);
131132
ContentStreamWriter writer = new ContentStreamWriter(out);
133+
132134
writer.writeTokens(objects);
133135
out.close();
134136
/* << write modified tokens back to the stream */

0 commit comments

Comments
 (0)