summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-07-11Implement dynamic page tree lookups.Tor Andersson
No more caching a flattened page tree in doc->page_objs/refs. No more flattening of page resources, rotation and boxes. Smart page number lookup by following Parent links. Naive implementation of insert and delet page that doesn't rebalance the trees. Requires existing page tree to hook into, cannot be used to create a page tree from scratch.
2013-07-04A minor path fix in winrt solution.Michael Vrhel
2013-07-04Update of winrt solution files for the reorganization that was recently ↵Michael Vrhel
undertaken
2013-07-04Fix up of a few issues in the project settings for winrtMichael Vrhel
2013-07-04Update pdf_write_document to support incremental updatePaul Gardiner
2013-07-03Avoid fz_throw/message on every annotation without appearance.Robin Watts
Annotations can sometimes not have appearance streams (such as Links). Avoid spewing messages to the console about this. Also avoids overhead of throw/catch each time.
2013-07-03Update fz_error/fz_warn to output to Debugger window on Win32 too.Robin Watts
Stupid windows debugger doesn't show stdout/stderr anywhere in non console apps, so add code to make errors/warnings visible.
2013-07-03Update Memento to output to debug window on windows.Robin Watts
Windows is stupid and doesn't display stderr/stdout in the debugger. Update Memento so that messages will appear there too.
2013-07-03Rename pdf_set_objects_parent_num to pdf_set_obj_parentRobin Watts
2013-07-03Avoid spurious, broken-annotation warning when appearance stream missingPaul Gardiner
2013-07-02Fix "mutool clean -ggg" operation.Robin Watts
When moving an object from one xref to a new xref, ensure firstly that we only drop each object once (by setting it to NULL) and secondly that it has the correct parent pointer.
2013-07-01Bug 694382: Fix use-after-free due to type3 fonts.Robin Watts
Thanks to zeniko for spotting the problem here. Type 3 fonts contain a reference to the resources objects required to render the glyphs. Traditionally these have been freed when the font is freed. Unfortunately, after recent changes, freeing a PDF object requires the pdf_document concerned to still exist. While in most cases the type 3 resources are not used after we have converted the type3 glyphs to display lists, this is not always the case. For uncachable Type 3 glyphs (such as those that do not completely define elements in the graphics state that they use, such as color or line width), we end up running the glyphs at interpretation time. [ Interpretation time = when doing a direct render on the main thread, or when creating a display list - so also on the main thread. No multi-threading issues with file access here. ] The fix implemented here is for each pdf document to keep a list of the type3 fonts it has created, and to 'decouple' them from the document when the document is destroyed. The sole effect of this decoupling is to remove the resources (and the PDF operator buffers) from the font. These are only ever used during interpretation, and no further interpretations are possible without the document being alive anyway, so this should have no net effect on operation, other than allowing cleanup to proceed cleanly later on.
2013-07-01Fix android app crashing after savePaul Gardiner
Make pdf_specifics callable with a NULL doc, as was fz_interact, which it replaces.
2013-06-28Add array_insert_drop and array_delete functions.Tor Andersson
Also add index argument to array_insert.
2013-06-28Fix merge mistake.Tor Andersson
2013-06-28Ensure altered objects are moved to the incremental xref sectionPaul Gardiner
2013-06-28Optimise xref-section extension and improve linked list creationPaul Gardiner
2013-06-28Modify FZ_NORETURN to work on MSVC too.Robin Watts
We need to have it as a prefix, not a postfix now, but it should work on both gcc and MSVC now.
2013-06-27Move to using a flags bit rather than "Dirty" dict entries.Robin Watts
Correct the naming scheme for pdf_obj_xxx functions.
2013-06-27Bug 694382: Fix problems arising from recent pdf_obj changes.Robin Watts
Thanks to zeniko for spotting these problems. When we close a document, purge the glyph cache to ensure that no type3 glyphs hang around with pointers to pdf_obj's that are now gone. Pass doc to pdf_new_obj_from_str rather than NULL. We believe that the reason this needed to be NULL is no longer valid. Also, revert to using an int for ref counts. In a quick test of our regression suite we only found 2 files that ever made a refcount > 256 (and they never got larger than 768), but the potential is there for issues. Reverting to an int until we can think of a better idea.
2013-06-26Ensure monotonicity of xref-section sizePaul Gardiner
2013-06-26Silence compiler warnings.Tor Andersson
2013-06-25Rework storing internal flags in PDF objects.Robin Watts
Before we render a page we need to evaluate whether we need transparency or not. To establish this, we recursively walk the resources looking for certain markers (blend modes, alpha levels, smasks etc). To avoid doing this repeatedly we'd like to stash the results somewhere. Currently we write a '.useBM' entry into the top level dictionary object, but with the recent changes to support incremental update this is not ideal - it has the effect of forcing all resources into the new section of the xref. So we avoid that horrible hack and use a different one; we make use of the new flags word in the pdf_obj structure. 1 bit is used to indicate whether we have stashed a (boolean) value here, and another bit is used to indicate what that value was.
2013-06-25Ensure that xref_sections always grow over time.Robin Watts
Never allow a new xref_section to be smaller than a previous one, as this makes pdf_xref_len(xref) get unexpectedly smaller.
2013-06-25Fix potential memory leakPaul Gardiner
2013-06-25Update ios project for reshuffle.Tor Andersson
2013-06-25Rid the world of "pdf_document *xref".Robin Watts
For historical reasons lots of the code uses "xref" when talking about a pdf document. Now pdf_xref is a separate type this has become confusing, so replace 'xref' with 'doc' for clarity.
2013-06-25Update pdf_obj's to have a pdf_document field.Robin Watts
Remove the fz_context field to avoid the structure growing.
2013-06-24Shrink pdf_obj type by using a flags word, and moving refs to a short.Robin Watts
'marked' moves into the flags word. 'kind' becomes an unsigned char. 'sorted' moves from in the dictionary specific bit of the object into the flags word. This should shrink us by 8 bytes.
2013-06-24Update annotation handling in preparation for incremental updatePaul Gardiner
When incremental update is in place, functions that alter one structure may have the side-effect of altering another: i.e., updating an annotation may require the Annots array or even the page to be cloned. This commit makes the existing annotation code hardy to this eventuallity. It also cleans up a slight mess of the past where not all annotation-altering functions had access to the pdf_annot struture, instead having to work with just the pdf object.
2013-06-24Update gitignore to account for the shufflePaul Gardiner
2013-06-24Free fz_context at end of win32 appPaul Gardiner
2013-06-24fix recent regressionszeniko
* at one place, code returns from inside an fz_try which borks up the error stack * pdf_load_xref wrongly assumes that at least one non-empty xref has been read if there were no errors thrown during parsing * pdf_repair_xref skips integers when object numbers are out of range
2013-06-24Fix "make all-nojs" target.Tor Andersson
2013-06-21Initial PDF editing/page creation commitRobin Watts
2013-06-21Fix Android builds.Robin Watts
Had to rejig the thumb entry/exit veneers to allow for NDK_PROFILER operation, but this seems to have negated the need for Core2.mk, so removed that here.
2013-06-20Fix default make target.Tor Andersson
2013-06-20Rename fz_image_to_pixmap to fz_new_pixmap_from_image.Tor Andersson
Match our naming conventions.
2013-06-20Update source, makefiles and win32 projects.Tor Andersson
2013-06-20Rearrange source files.Tor Andersson
2013-06-20Comment fixes (rename fz_ to pdf_ was missed)Robin Watts
2013-06-19Fix up of issues in Windows 8 app prior to submission to Windows storeMichael Vrhel
Fix of logos and icons to match Android and iOS applications. Switch to using DLL for the mupdf winRT library. Static libraries for winRT defined calls is not allowed. Added linker options for security issues. Also fix of some circular header/namespace issues.
2013-06-19Android build fixes.Robin Watts
2013-06-19Exception handling fixes.Robin Watts
Various tweaks to ensure the exception handling works as expected when throwing error values. The key thing is not to reset the error value on a try, as this can cause problems when code calls trys in the always section.
2013-06-19Use subdirs in build directory for thirdparty libraries.Tor Andersson
2013-06-19Fix exception handling changes in X11 app.Tor Andersson
2013-06-19Move pixmap md5 summing into pixmap.cTor Andersson
2013-06-19Fix of winRT solution with changes to header files in mupdfMichael Vrhel
2013-06-19Addition of code to allow files to be opened from skydrive and for app to be ↵Michael Vrhel
file activated. Also fixed a few issues for when we open a new file and close the current contents. There was an issue with the displaylist cache clean up.
2013-06-19Exception handling changesRobin Watts
In preparation for work on progressive loading, update the exception handling scheme slightly. Until now, exceptions (as thrown with fz_throw, and caught with fz_try/fz_catch) have merely had an informative string. They have never had anything that can be compared to see if an error is of a particular type. We now introduce error codes; when we fz_throw, we now always give an error code, and can optionally (using fz_throw_message) give both an error code and an informative string. When we fz_rethrow from within a fz_catch, both the error code and the error message is maintained. Using fz_rethrow_message we can 'improve' the error message, but the code is maintained. The error message can be read out using fz_caught_message() and the error code can be read as fz_caught(). Currently we only define a 'generic' error. This will expand in future versions to include other error types that may be tested for.