summaryrefslogtreecommitdiff
path: root/platform/java
AgeCommit message (Collapse)Author
2017-01-09java: Handle outlines with duff links.Tor Andersson
2017-01-09java: Fix encoding problems when turning strings into java strings.Tor Andersson
Most strings coming out of various MuPDF functions are already decoded to utf-8; so manually decoding from PDFDocEncoding or UCS-2 is actually harmful rather than helpful.
2017-01-09java: Use default build type when compiling.Sebastian Rasmussen
The default choice is overridden in the same way as for a normal compile.
2017-01-09java: Automatically determine openjdk path.Sebastian Rasmussen
Also allow for overriding the decision by setting JAVA_HOME.
2016-12-27Strip extraneous blank lines.Tor Andersson
2016-11-17Build Java viewer with libcrypto support if available.Sebastian Rasmussen
2016-11-16pdf: Add 'compressed/raw' flag to pdf_add_stream.Tor Andersson
Also expose the argument to JS and JNI.
2016-11-15Fix Java 32/64bit detection.Robin Watts
Fix some java typos. Thanks to Fred for nicely pointing out that I'd been testing the wrong build. Also, make us default to 32bit if sun.arch.data.model is not defined, as Android doesn't set this. We will need to find a nice way to spot 32/64 bittedness on Android.
2016-11-15Update JNI code to load 32 or 64 bit DLL as appropriate.Robin Watts
Make the JNI code detect whether it is running on a 32 or 64 bit machine, and change the name of the DLL appropriately. Update Android Makefile to make mupdf_java32 instead of mupdf_java. Update Java Makefile to make mupdf_java32 or mupdf_java64 based on the system it is running on. This choice can be overruled by defining BITS to be "32" or "64" before calling make. Update Windows Solution to make mupdf_java32 or mupdf_java64 as appropriate.
2016-11-14Make fz_buffer structure private to fitz.Robin Watts
Move the definition of the structure contents into new fitz-imp.h file. Make all code outside of fitz access the buffer through the defined API. Add a convenience API for people that want to get buffers as null terminated C strings.
2016-11-14Add/fix page coordinates to link targets.Tor Andersson
Correctly transformed target coordinates for PDF. Target coordinates for EPUB and HTML.
2016-11-14Add optional 'object' argument to pdf_add_stream.Tor Andersson
2016-11-11Update JNI code to compile on Win32 and Win64.Robin Watts
Just some typecasting required.
2016-11-08Change access to protected on parts of Image.java to allow AndroidImage to ↵fred ross-perry
build.
2016-11-03Fix MSVC build of JNI native code.Robin Watts
2016-11-03jni: Make it easy to use stext without options.Sebastian Rasmussen
2016-11-03jni: Only release stext options when present.Sebastian Rasmussen
2016-11-02jni: Add AndroidImage, using Android Bitmaps to create Images.Sebastian Rasmussen
2016-10-28Clean up link destination handling.Tor Andersson
All link destinations should be URIs, and a document specific function can be called to resolve them to actual page numbers. Outlines have cached page numbers as well as string URIs.
2016-10-26Update ios/android to use new way of passion stext options.Sebastian Rasmussen
In addition, make all callers passing 0 as a point pass NULL instead.
2016-10-21jni: Update mupdf_native.h.Tor Andersson
2016-10-16Avoid casting when dropping super objects.Sebastian Rasmussen
2016-10-07Update Android build with fz_font/fz_colorspace API changes.Robin Watts
2016-09-23JNI: Improve string/name encoding handling.Robin Watts
At the moment, when we create java Strings from string or name PDFObjects, we assume they are all in javas not-quite-UTF-but-almost encoding. Here we assume they are in standard PDF format (namely that if they do not start with one of 2 specific BOMs, that they are in PDFDocEncoding). We update the code to convert to unicode, and create strings from that. This has the added side effect of correctly coping with 0 bytes in the middle of string buffers.
2016-09-23Android example: move kankan module.Fred Ross-Perry
Out of platform/java and into the platform/android/example.
2016-09-23JNI: Fix typo in logic.Robin Watts
2016-09-23JNI: Rework conversion functions and nulls.Robin Watts
Java has a convention that 'toString' should return a printable version of an object. We cannot both support this, and support a sane naming of functions to interpret pdf objects that begins with 'to'. Instead use 'as'. This means we have 'asBoolean', 'asInteger', 'asString' which expect to work just on pdf objects of the required type. 'toString' continues to work on all types and gives a printable version. We split 'toByteString' into 2 separate functions, one for acting on strings (asByteString) and one for acting on names (asByteName) more nicely mirroring the C level functions (pdf_to_string and pdf_to_name). For simplicity of use, we add asString and asName functions that return using java Strings rather than byte arrays. There are potential encoding issues with these, but then there are throughout our string handling at the moment, so we will deal with those in a followup commit. We also update the internal workings of several functions so that they never return NULL pointers, but rather return the null object. To avoid repeatedly creating new null objects we introduce a global static PDFObject.Null object. This is important as we want get("SomethingNonexistent") to return a valid java object, so we can safely do things like: get("Foo").get("Bar").get("Baz").asInteger() without having to error check at every stage. Update DocViewActivity to call the new versions.
2016-09-23Clean up annotation enum names.Tor Andersson
Put them in the PDF name space and separate words with underscores. Remove redundant namespace prefixes in java constants. Device.FLAG_MASK rather than Device.FZ_DEVFLAG_MASK. Use namespace for PDF annotation flag enum.
2016-09-18JNI: Finalizers must be able to run with pointer being null.Sebastian Rasmussen
Applications must be able to run e.g. Document.destroy() and later set that reference to null and have the JVM successfully run the finalizer an arbitrary time later. Previously the JVM would fail to do so because the finalizer would throw an exception since the native pointer was null.
2016-09-17Java bindings: Improve exception messagesRobin Watts
2016-09-16Call Memento_fin in java Document_destroy().Robin Watts
As reasonable a place to call it as we can hope for. If we ever have 2 documents open and we close 1 then it will dump more blocks than we like, but when we get to that stage we can worry about it then.
2016-09-16Android JNI context fixes.Robin Watts
In the JNI code, we attach a cloned context onto each thread we encounter in thread local storage. When the thread shuts down, we should destroy that context. This can theoretically be achieved on pthreads by using the destructor registered to the tls slot. I have yet to see Android ever actually call this destructor yet though. No such mechanism exists for windows thread, so we'll just leak here for now. There is a potential fix for this, but it's hairy, so details are left in a comment in the code.
2016-09-16JNI: Handle the case where an object's native pointer is NULL.Sebastian Rasmussen
If Java code creates e.g. a Document object and later calls Document.destroy() and then keeps using the Document object the library would end up crashing because the native pointer was null. This case rather special case is now handled.
2016-09-16JNI: Do not fail on using null as a value in a dictionary.Sebastian Rasmussen
The underlying pdf_dict_put() converts into a null object.
2016-09-16JNI: Check if get_context has thrown exception,Sebastian Rasmussen
But do not check it twice.
2016-09-16JNI: Avoid throwing IllegalargumentException.Sebastian Rasmussen
2016-09-16JNI: Avoid getting context if not needed.Sebastian Rasmussen
2016-09-16JNI: Remove forgotten FIXME.Sebastian Rasmussen
This case can be handled gracefully since commit 2d3eca6dec6b8fc7a169b3fc357904069df6b6c4.
2016-09-15JNI: Ensure that BufferInputStream position is in range.Sebastian Rasmussen
2016-09-15JNI: Catch fitz exceptions and convert to Java exceptions.Sebastian Rasmussen
2016-09-15JNI: Don't replace Java exception with one from fitz.Sebastian Rasmussen
The JNI interface throws exceptions of its own, keep those instead of replacing them.
2016-09-15JNI: Throw IllegalArgumentException for null arguments.Sebastian Rasmussen
2016-09-15JNI: Delete global ref to Separation class after use.Sebastian Rasmussen
2016-09-15JNI: Rename member variable to fit with usage.Sebastian Rasmussen
Page_getSeparation() does the corresponding conversion.
2016-09-15JNI: Check context in consistent way.Sebastian Rasmussen
Also there is no need to check self pointer since JVM does not even call the JNI binding for null pointers.
2016-09-15JNI: Fix compiler warning about unused variables.Sebastian Rasmussen
2016-09-14Rename helper function in mupdf_native.cRobin Watts
This avoids a symbol clash when using scripts/destatic.sh
2016-09-14Android example - Add proofing support.fred ross-perry
2016-09-14Android example - drawing ink annotationsfred ross-perry
This commit puts in the UI for drawing with color and line thickness. But it does not yet save this to the document.
2016-09-14Fix clang compiler warnings.Sebastian Rasmussen