summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-23Java code to get embedded profile name from a PDF.Robin Watts
To be used to make correct profile invocations.
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-23Check for buffer overflow in strtod ascii division.Tor Andersson
2016-09-23Fix warning: set but unused variable.Tor Andersson
2016-09-23Add 'make android' target to build android viewer.Tor Andersson
2016-09-23Update MuJS.Tor Andersson
2016-09-22GPROOF: Modify gs invocation.Michael Vrhel
If we get the print profile given as '<EMBEDDED>' then use the print profile (Output Intent) embedded in the file. If not, we continue to use the defaults if given the empty string, or the given file otherwise.
2016-09-23Bug 697021: Count used string space correctly.Sebastian Rasmussen
Account for used space before comparison, not after.
2016-09-23Bug 697020: Remove variable only ever written to.Sebastian Rasmussen
2016-09-22Include Java files when creating source tags.Sebastian Rasmussen
2016-09-22tools: Prefer fz_atof() to atof().Sebastian Rasmussen
2016-09-22GProof: When invoking gs, redirect gs stdio to local stderr.Robin Watts
For android this means it will go to our logging. This moves the code out of gs.
2016-09-22Bug 697015: Avoid object references vanishing during repair.Robin Watts
A PDF repair can be triggered 'just in time', when we encounter a problem in the file. The idea is that this can happen without the enclosing code being aware of it. Thus the enclosing code may be holding 'borrowed' references (such as those returned by pdf_dict_get()) at the time when the repair is triggered. We are therefore at pains to ensure that the repair does not replace any objects that exist already, so that the calling code will not have these references unexpectedly invalidated. The sole exception to this is when we replace the 'Length' fields in stream dictionaries with the actual lengths. Bug 697015 shows exactly this situation causing a reference to become invalid. The solution implemented here is to add an 'orphan list' to the document, where we put these (hopefully few, small) objects. These orphans are kept around until the document is closed.
2016-09-22Bug 697018: Avoid recursing infinitely on dicts in mutool info.Sebastian Rasmussen
2016-09-21fix the quotes fixfred ross-perry
2016-09-21Bug 697106: Mark 64bit constants as such.Robin Watts
Avoids gcc giving spurious warnings.
2016-09-21Gproof GS invocation: Only quote profile names if required.Robin Watts
We need to quote profile names if we use system, but not if we use the GS_API. Update the code to cope.
2016-09-21Update GPRF invocation of GSRobin Watts
Have both the GSAPI and non GSAPI invocations be identical. Remove the -rxx bit because it is not required when using -gWxH and -dFitPage. Add some simple debug code.
2016-09-21Android example - don't do any layout after the document has been destroyed.fred ross-perry
2016-09-20Fix Memento crashRobin Watts
When reallocing set the rawsize before attempting to write the post guard block.
2016-09-20Sync Memento with gs.Robin Watts
Including: Bug 697134: Tweak MEMENTO_GS_HACKS inclusion. Rather than rolling our own memset prototype in this case, use the one that gs provides. And, bug 697133: Fix typo in Memento. Causing a significant slowdown. Thanks to George Burgess IV for spotting this.
2016-09-20Avoid signed/unsigned warnings.Robin Watts
2016-09-20SVG: If no width/height given, then guess from viewBox.Robin Watts
2016-09-19Update SVG document handler; circles.Robin Watts
Cope with circles, rounded rects, etc. Not the worlds best approximation to a circular arc, but it's better than nothing.
2016-09-19fz_store: Reap passes.Robin Watts
A few commits back, we introduced the fz_key_storable concept to allow us to cope with objects that were used both as values within the store and as parts of keys within the store. This commit worked, but showed up performance problems; when the store has several million PDF objects in it, bulk changes (such as dropping a display list or document) could trigger many passes across the store. We therefore introduce a mechanism to ameliorate this. These passes, now known as "reap passes", can be batched together using fz_defer_reap_start and fz_defer_reap_end. We trigger this start/end around display list dropping, and around PDF content stream processing. This should be fine, as deferral will be interrupted if we ever run our of memory during mallocing.
2016-09-19Make fz_printf() handle %lu.Sebastian Rasmussen
2016-09-19jpx: Fix off by one in palettized images.Sebastian Rasmussen
2016-09-19svg: Throw on nonconforming transform attributes.Sebastian Rasmussen
2016-09-18svg: Use fz_atof() and fz_strtod().Sebastian Rasmussen
2016-09-18Make printing empty hash table entries optional.Sebastian Rasmussen
2016-09-18Fix printing of hash table.Sebastian Rasmussen
2016-09-18Make fz_printf() support %p.Sebastian Rasmussen
This is used at several places in mupdf.
2016-09-18svg: Ensure that read svg file is null-terminated.Sebastian Rasmussen
fz_parse_xml() assumes a null-terminated xml string.
2016-09-18svg: Fix typo in opacity attribute variable name.Sebastian Rasmussen
2016-09-18Free fz_tree nodes when dropping tree.Sebastian Rasmussen
2016-09-18tiff: Do not assume that images always have alpha component.Sebastian Rasmussen
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-17Squash some memento warnings in MEMENTO_LEAKONLY builds.Robin Watts
2016-09-17Android app: Update rgba -> bgra.Robin Watts
The separation class had a member renamed. Rename it here too.
2016-09-17Java bindings: Improve exception messagesRobin Watts
2016-09-16Remove unused variable.Robin Watts
2016-09-16Correct assertion in pdf-store.Robin Watts
We can use names as keys for colorspaces. These are not bound to a particular document.
2016-09-16Add some missing #ifdeffery for Memento.Robin Watts
2016-09-16More tweaking of gproof device gs invocation.Robin Watts
If USE_GS_API is defined, we use the gsapi interface to call gs. The gsapi interface is defined in iapi.h, which is not included in the mupdf source code. We therefore include a potted version of this API inline. To use the original, pass HAVE_IAPI_H at compile time.
2016-09-16MSVS: Make libfonts consistent with other projectsRobin Watts
Its output directory was set differently.
2016-09-16Bug 695988: Avoid sending image data multiple times.Robin Watts
If the same image is used repeatedly, then we currently send the data again and again. Instead, send each image as a reusable symbol and reuse it as required. This reduces the size of the output by over 50% for the example file, but unfortunately results in the example file killing both Firefox and Edge when we attempt to load it. The file seems entirely valid though, and this is a saving on sane files. There is a #define that can be made to revert to the old behaviour (SVG_SEND_REPEATED_IMAGES).
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-16Silence some warnings.Robin Watts