diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-07-17 16:55:17 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-07-17 22:33:52 +0800 |
commit | 014fb58f887086ea34f74dcdb0d91dbec05966d1 (patch) | |
tree | 7097cdb9854360e3579592fd8df0135907e5ffb3 /platform/java/src/com/artifex | |
parent | bbb324fad31db437d668eb4891473231c3520792 (diff) | |
download | mupdf-014fb58f887086ea34f74dcdb0d91dbec05966d1.tar.xz |
JNI: When adding stream/page contents, accept String.
This is for easy of use, in addition to accepting Buffer.
Diffstat (limited to 'platform/java/src/com/artifex')
-rw-r--r-- | platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java b/platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java index 58a3e3a6..c049d336 100644 --- a/platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java +++ b/platform/java/src/com/artifex/mupdf/fitz/PDFDocument.java @@ -41,9 +41,28 @@ public class PDFDocument public native PDFObject createObject(); public native void deleteObject(int i); - public native PDFObject addStream(Buffer buf); + public native PDFObject addStreamBuffer(Buffer buf); + public native PDFObject addStreamString(String str); + + public PDFObject addStream(Buffer buf) { + return addStreamBuffer(buf); + } + + public PDFObject addStream(String str) { + return addStreamString(str); + } + + public native PDFObject addPageBuffer(Rect mediabox, int rotate, PDFObject resources, Buffer contents); + public native PDFObject addPageString(Rect mediabox, int rotate, PDFObject resources, String contents); + + public PDFObject addPage(Rect mediabox, int rotate, PDFObject resources, Buffer contents) { + return addPageBuffer(mediabox, rotate, resources, contents); + } + + public PDFObject addPage(Rect mediabox, int rotate, PDFObject resources, String contents) { + return addPageString(mediabox, rotate, resources, contents); + } - public native PDFObject addPage(Rect mediabox, int rotate, PDFObject resources, Buffer contents); public native void insertPage(int at, PDFObject page); public native void deletePage(int at); public native PDFObject addImage(Image image); |