summaryrefslogtreecommitdiff
path: root/platform/java/src/com/artifex
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-11-15 16:10:03 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-11-16 12:09:20 +0100
commitfa9cd67527ab9994fec917f0f88fc16abb9926a6 (patch)
tree9f533a52350e32b0d778c158fbb4eafbe0d0d12e /platform/java/src/com/artifex
parent5ed7e6c29233874a68733cdf075260fe261caa40 (diff)
downloadmupdf-fa9cd67527ab9994fec917f0f88fc16abb9926a6.tar.xz
pdf: Add 'compressed/raw' flag to pdf_add_stream.
Also expose the argument to JS and JNI.
Diffstat (limited to 'platform/java/src/com/artifex')
-rw-r--r--platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java32
1 files changed, 28 insertions, 4 deletions
diff --git a/platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java b/platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java
index 601919d7..f866cb86 100644
--- a/platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java
+++ b/platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java
@@ -48,15 +48,39 @@ public class PDFDocument
public native PDFGraftMap newPDFGraftMap();
public native PDFObject graftObject(PDFDocument src, PDFObject obj, PDFGraftMap map);
- private native PDFObject addStreamBuffer(Buffer buf);
- private native PDFObject addStreamString(String str);
+ private native PDFObject addStreamBuffer(Buffer buf, Object obj, boolean compressed);
+ private native PDFObject addStreamString(String str, Object obj, boolean compressed);
+
+ public PDFObject addRawStream(Buffer buf, Object obj) {
+ return addStreamBuffer(buf, obj, true);
+ }
+
+ public PDFObject addStream(Buffer buf, Object obj) {
+ return addStreamBuffer(buf, obj, false);
+ }
+
+ public PDFObject addRawStream(String str, Object obj) {
+ return addStreamString(str, obj, true);
+ }
+
+ public PDFObject addStream(String str, Object obj) {
+ return addStreamString(str, obj, false);
+ }
+
+ public PDFObject addRawStream(Buffer buf) {
+ return addStreamBuffer(buf, null, true);
+ }
public PDFObject addStream(Buffer buf) {
- return addStreamBuffer(buf);
+ return addStreamBuffer(buf, null, false);
+ }
+
+ public PDFObject addRawStream(String str) {
+ return addStreamString(str, null, true);
}
public PDFObject addStream(String str) {
- return addStreamString(str);
+ return addStreamString(str, null, false);
}
private native PDFObject addPageBuffer(Rect mediabox, int rotate, PDFObject resources, Buffer contents);