summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2017-11-22Remove unused annotation function.Tor Andersson
2017-11-22jni/js: Add support for annotation modification dates.Sebastian Rasmussen
2017-11-22jni/js: Use correct text encoding in annotation author and contents.Fred Ross-Perry
Also clarify that a copy of author/contents is returned, and that the caller must free them.
2017-11-22jni/js: Add interfaces for creating UTF-16BE and PDF byte strings.Sebastian Rasmussen
This mirrors the existing PDFObject.asByteString().
2017-11-22Add pdf_new_text_string utility function.Tor Andersson
Create a PDF 'text string' type string from a UTF-8 input string. If the input is plain ASCII, keep it as is, otherwise re-encode it as UTF-16BE.
2017-11-22jni: Make sure to dirty annotation whenever it changes.Fred Ross-Perry
2017-11-22jni: Return correct quadpoints coordinates.Sebastian Rasmussen
2017-11-22jni: Return correct inklist coordinates.Sebastian Rasmussen
2017-11-22js: Return undef when not finding metadata.Sebastian Rasmussen
Previously when metadata was not found mupdf still tried to return a string to the caller, but the string was uninitialized.
2017-11-22Add usage for missing options to pdf-write.Sebastian Rasmussen
2017-11-22Prefer using fz_snprintf over snprintf.Sebastian Rasmussen
This way the MuPDF library itself only uses fz_snprintf for consistent formatting.
2017-11-22Use custom allocator everywhere zlib is used.Sebastian Rasmussen
2017-11-22Warn on irretrievable glyph name.Sebastian Rasmussen
2017-11-22Skip unnecessary newline when writing ASCII streams.Tor Andersson
2017-11-17Fix build if lcms2 is not present.Tor Andersson
We NEED lcms2art (the artifex branch) and cannot build with stock lcms2. Disable ICC support if the lcms2 thirdparty library is not present.
2017-11-15Bug 698740: Avoid NULL fz_default_colorspaces structures.Robin Watts
Remove code left over from development that is now wrong. We should have default colorspaces in the system, even in NON_ICC builds.
2017-11-15Bug 698745: Avoid broken colorspaces in NO_ICC builds.Robin Watts
If we attempt to make an icc colorspace in a NO_ICC build, throw an exception. This stops us ending up with 'UNKNOWN' colorspaces in the system.
2017-11-14Ensure that after_text functions get ctm.Robin Watts
Also wrap their contents in q/Q, so they can't screw up the rest of the stream.
2017-11-14Ensure filter inits the Trm values on a BT.Robin Watts
Otherwise we can get empty bbox values.
2017-11-14Rejig filter internals slightly.Robin Watts
Hold 2 instances of a structure, rather than a structure with 2 of each fields in it. Also, correct the logic for when we send color changes.
2017-11-13Never draw Popup annotations.Tor Andersson
Popup annotations should never have an appearance stream, but in case they do we shouldn't draw them. The Open property is only to toggle whether the GUI should be showing the Content text editing in a Popup (or Text) annotation, and should not affect drawing the page.
2017-11-13Bug 698369: Fix stroking issue when closepath is infinitessimal.Robin Watts
If the move due to a closepath is infinitessimal, fz_stroke_lineto skips it as it cannot accurately figure out what the direction is. It appears we have had some code in fz_stroke_closepath to cope with exactly this case, but it does the wrong thing. This dates back all the way to the initial import of the code, so presumably it worked at some point, and stopped working somewhere along the line.
2017-11-10Remove fz_android_fprintf.Tor Andersson
Use android logging for throw/warn like we do with OutputDebugString on windows.
2017-11-10Fix potential problem with null path segments leaving dots.Robin Watts
When stroking paths if we meet segments of 0 length, we can't determine a direction, thus start/end caps are omitted. Line widths are irrelevant, and we thus render nothing. (Note that moves on their own do NOT count as a line segment). The exception to this is where we are using round caps, whereupon whatever direction the path is taken to have, the appearance will be the same - and this we render the segment as a dot. We have code in the renderer already to do this, but it looks to me like it could be fooled into leaving a dot by us first doing a move, a lineto the same point, and then a lineto to somewhere else. The current code sets the 'dot' value to 1 when it detects the degenerate line, and doesn't reset when it meets a non-degenerate line later. Accordingly I've changed the code here to account for such a circumstance. This produces no diffs in the cluster testing, but seems more correct to me.
2017-11-10Remove unused variables.Tor Andersson
2017-11-09Bug 698307: Improve stdint.h detection logic in openjpeg wrapper.Robin Watts
Thanks to Tamir Evan for this tweak.
2017-11-09Bug 698353: Avoid having our API depend on DEBUG/NDEBUG.Robin Watts
Currently, our API uses static inlines for fz_lock and fz_unlock, the definitions for which depend on whether we build NDEBUG or not. This isn't ideal as it causes problems when people link a release binary with a debug lib (or vice versa). We really want to continue to use static inlines for the locking functions as used from MuPDF, as we hit them hard in the keep/drop functions. We therefore remove fz_lock/fz_unlock from the public API entirely. Accordingly, we move the fz_lock/fz_unlock static inlines into fitz-imp.h (an internal header), together with the fz_keep_.../fz_drop_... functions. We then have public fz_lock/fz_unlock functions for any external callers to use that are free of compilications. At the same time, to avoid another indirection, we change from holding the locking functions as a pointer to a struct to a struct itself.
2017-11-09Avoid mu-office-lib calling fz_lock.Robin Watts
It was only ever calling fz_lock for its own lock. This was an abuse at best, and could potentially have caused trouble with the deadlock detection code. Instead, lock the same lock, but do so using custom (static) functions.
2017-11-09Squash warning.Robin Watts
2017-11-08Bug 698460: Mudraw: Set stdout to binary on windowsRobin Watts
2017-11-08Clean up and speed up text searching.Tor Andersson
2017-11-08Select and copy structured text by lines.Tor Andersson
2017-11-08Remove broken bidi reordering code.Tor Andersson
TODO: Implement visual to logical reordering on the fly when building the structured text line.
2017-11-08Silence warning.Tor Andersson
2017-11-08Move static inline function out of header.Tor Andersson
2017-11-08Bug 698467: Honour resolution in text extraction.Robin Watts
This affects the given character bboxes.
2017-11-08Use fz_snprintf in preference to snprintf.Robin Watts
If nothing else, this avoids warnings on VS2005.
2017-11-08Fix TGA banded operation.Robin Watts
Also, fix mudraw messages about what types can be banded.
2017-11-08Pixmap writers for formats with alpha should handle premultiplied data.Robin Watts
Any pixmap writers that can handle data with an alpha plane should accept that data in premultiplied form, and write it out appropriately for the file format. This avoids the need to unpremultiply data in mudraw, and solves the issue we were seeing where we want the png writer to be able to cope with premultiplied data (such as for the debug blending routines) and unpremultiplied data (such as that given after mudraw has unpremultiplied the data).
2017-11-08Bug 689699: Avoid buffer overrun.Robin Watts
When cleaning a pdf file, various lists (of pdf_xref_len length) are defined early on. If we trigger a repair during the clean, this can cause pdf_xref_len to increase causing an overrun. Fix this by watching for changes in the length, and checking accesses to the list for validity. This also appears to fix bugs 698700-698703.
2017-11-08Bug 698704: Fix for overflow check failing due to 'clever' compiler.Robin Watts
Adopt Josephs suggested fix for arithmetic overflow. Thanks to Kan-Ru Chen for spotting the problem.
2017-11-08Bug 698689: Don't create a hint stream for a file with 0 pages.Robin Watts
2017-11-06Expose text filtering through pdf_clean interface.Robin Watts
2017-11-06Use text state handling in pdf_filter_processor to filter text.Robin Watts
2017-11-06Extract text state handling from run pdf_processor.Robin Watts
So it can be used in the filter pdf_processor too.
2017-11-02Fixes for win32 build.Tor Andersson
2017-11-01Add separate fz_close_output step.Tor Andersson
Closing flushes output and may throw exceptions. Dropping frees the state and never throws exceptions.
2017-11-01Use int64_t for public file API offsets.Tor Andersson
Don't mess with conditional compilation with LARGEFILE -- always expose 64-bit file offsets in our public API.
2017-11-01Don't use 'long' needlessly.Tor Andersson
2017-11-01Silence warning.Tor Andersson