summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-08-10Forms: handle Keystroke and Validate actionsPaul Gardiner
2012-08-10Forms: move js-side event setup out of execute_actionPaul Gardiner
Makes it easier to alter the setup for some action types
2012-08-10Forms: alter the handling of the javascript event objectPaul Gardiner
2012-08-09Forms: fix windows build after mergePaul Gardiner
No idea how it seemingly worked without these changes.
2012-08-08Merge branch 'master' into formsPaul Gardiner
Conflicts: Makefile apps/mudraw.c pdf/pdf_write.c win32/libmupdf-v8.vcproj
2012-08-07Update VS solutions to new thirdparty files.Robin Watts
2012-08-07Remove fz_too_deeply_nested.Robin Watts
Rather than specifically checking for the nesting getting too deep and hence throwing an error, the error handling should do this for itself. Make it so that we spot the depth being too great in the fz_try() and throw to the fz_catch().
2012-08-07Fix various problems with linearisation when saving.Robin Watts
Unused objects could cause problems with the sort order and picking the object to start with. Now coped with. If the hintstream object replaces another object that already had a stream, pdf_open_raw_filter would get confused by the presence of a stm_buf. Now fixed. Fix a 64bit problem in page_objects_list_ensure, as well as tweaking the code for readability. When outputting single page files, we can end up with opts->start = 1 and this upset the offset calculating logic. Insist on compacting the xref when linearising. Thanks to Sebras and Zeniko for providing test cases. This commit should (hopefully) stop the SEGVs, but there are still cases where Acrobat doesn't think that the files output are "Optimised for Fast Web View". I cannot see why.
2012-08-07Forms: simple appearance generation for choice widgetsPaul Gardiner
2012-08-07When updating an xobject's contents also reset the LengthPaul Gardiner
2012-08-07Forms: for choices with a single selection avoid an unnecessary arrayPaul Gardiner
Also delete the 'I' element to avoid the indexes and values disagreeing.
2012-08-07Forms: mark choice field dirty after value change (and fix error handling)Paul Gardiner
2012-08-06Fix leak of page objects/refs for documents without page treeSebastian Rasmussen
PDF documents that do not have a page tree will have zero pages. Calling fz_count_pages() twice or more on those documents will have pdf_load_page_tree() repeatedly trying to load the page tree, each time leaking the page objects/refs arrays. Thanks to Zeniko for pointing out this fix.
2012-08-06Check for a display list before trying to render it in pdfappSebastian Rasmussen
Previously fix 13943b92f10796efb175e769afe5b0aea85d879a introduced continued rendering of further pages for documents where one page failed to load. However, if the entire page tree was missing from a PDF document then no display list would be obtained, yet MuPDF tried to render the display list causing a null pointer dereference. Now, check for a valid display list before trying to render it.
2012-08-06Remove old error mesages turned into comments when adding exceptionsSebastian Rasmussen
2012-08-06Handle out of range encoding differences for type3 fontsSebastian Rasmussen
Thanks to Zeniko for pointing out this fix.
2012-08-06Rewording of warning messages for PDF functionsSebastian Rasmussen
2012-08-06Add option to mudraw to process further files upon errorSebastian Rasmussen
2012-08-06Free jpeg state upon decoding error, even if not fully initedSebastian Rasmussen
Previously the jpeg decoder state had to be fully initialized in order to be freed when the jpeg decoder is closed, e.g. due to an error. Now, signal that the decode state is initialized earlier, even if the state has not been fully initialized, so that the state is freed.
2012-08-06Free entire type3 font descriptor upon loding error, not just the fontSebastian Rasmussen
2012-08-06Check whether font in xps has charmap before using itSebastian Rasmussen
Thanks to Zeniko for pointing out this fix.
2012-08-06Make fz_open_file_*() always throw exceptions upon errorSebastian Rasmussen
Thanks to Zeniko for pointing out the inconsistency.
2012-08-06Fix locking bug in path strokingSebastian Rasmussen
Thanks to Zeniko for pointing out this fix.
2012-08-06Update PDF metadata to include both PDF encryption version and revisionSebastian Rasmussen
2012-08-06Expose both PDF encryption version and revisionSebastian Rasmussen
Thanks to Zeniko for pointing out that version as missing.
2012-08-06Free old stroke state when initing graphics state from another stateSebastian Rasmussen
Thanks to Zeniko for pointing out this fix.
2012-08-06Free inline image dictionary upon error parsing imageSebastian Rasmussen
2012-08-06Throw exception on too deeply nested arrays/dictsSebastian Rasmussen
Previously we would run out of error stacks in the context and fail abruptly. Now, throw an exception and hope for the best. At least this plugs any memory leaks.
2012-08-06Only warn on stitching function's sub function with wrong aritySebastian Rasmussen
Sub functions that make up a stitching function can be evaluated with the wrong number of inputs/outputs, so it is not necessary to throw an exception if the number of inputs/outputs do not match when loading sub functions.
2012-08-06Fix comparison of cmap table length against maximum valueSebastian Rasmussen
The cmap table length counts how many entries there are currently in the table. The table length was previously tested against USHRT_MAX which is 65535. However, the desired value to compare with was 65536 which would be the maximum number of entries allowed in a cmap table. All comparisons of the cmap table length are now using USHRT_MAX + 1.
2012-08-06Upon parse error when repairing, make sure object stream is freedSebastian Rasmussen
Previously, during repair of a pdf, an object stream was loaded and an attempt was made at repairing the objects stored inside the object stream. Failure to repair the stream caused an exception which was not handled by the code loading the object stream, it was just passed on. This meant that the loaded object stream caused a memory leak. Now we catch that exception, free the object stream and rethrow the exception.
2012-08-06Make sure images are freed upon loading errorSebastian Rasmussen
There was a call to fz_drop_image() in the error handling code, however the fz_storable freeing function was not yet set which meant that the image was not freed. Instead call pdf_free_image() to free the image.
2012-08-06Add a make target for measuring code coverageSebastian Rasmussen
2012-08-06Free decoded jpx image upon errorSebastian Rasmussen
Thanks to Zeniko for pointing out this fix.
2012-08-06No need to drop object for which no reference has been keptSebastian Rasmussen
2012-08-06Make use of fz_always instead of repeating code for error and normal pathSebastian Rasmussen
2012-08-06Set refs to NULL in pdf repair so object are not freedSebastian Rasmussen
2012-08-06No need to check for NULL before dropping objectsSebastian Rasmussen
2012-08-06Handle exceptions better in mupdfcleanSebastian Rasmussen
pdf_write_document() may throw an exception and this was uncaught up until now.
2012-08-06Fix bug where too many content stream operands cause eternal loopSebastian Rasmussen
Once enough operands were push on top of the operand stack an exception would be thrown. The exception handling ignored the exception, printed a warning and continued processing the content stream. Unfortunately the token was never consumed, so once the interpreter retried parsing the stream it encountered the same token again, causing the loop and thus a stack overflow. Now, make sure each token is consumed before throwing a new exception thereby breaking the eternal loop and letting pdfs with excessive operands be rendered, albeit with both errors and a warning.
2012-08-06Only warn once about ignoring rendering errorsSebastian Rasmussen
2012-08-06Handle invalid obj/gen numbers when repairing pdfsSebastian Rasmussen
Out of range object numbers cause the repaired object to be ignored. Out of range generation numbers are clamped to the permitted range.
2012-08-06Fix typo in PDF function codeSebastian Rasmussen
This is just a lexical change, no semantic change as the MAXN and MAXM constants are equal.
2012-08-06Always rebuild static libraries in unix, instead of updating themSebastian Rasmussen
The u modifier to to the ar replace command tells ar to only insert those object files into a static library that are newer than those already in the library (both having the same name). Moreover ar only stores timestamps down to second accuracy. This may cause situations where the object file already inside the library is considered equal to a newly built object file (which might include a new function) because their timestamps differ only in the sub-second part. One of the apps might have an object file that references this new function. Since the static library retains the old object file there will be a linking error when linking the app. Even re-running make will not fix the issue since the static library will have its modification time updated to a timestamp later than the newly built object file, which means that ar will not be run again. The only option is to make nuke and rebuild from scratch. From now on, the u modifier to the ar replace command is removed. This means that ar will rebuild static libraries without taking timestamps of object files into account, to make sure that the build never ends up in the situation described above.
2012-08-03Forms: add basic support for choice widgets to the Windows appPaul Gardiner
2012-08-03Forms: move javascript utility filePaul Gardiner
2012-08-02Fix bug in writing of strings: backslash not quotedPaul Gardiner
2012-08-02Forms: implement saving on 'S' keyPaul Gardiner
2012-08-02Forms: add support for save on exit to the windows appPaul Gardiner
2012-08-02Forms: add document dirty flagPaul Gardiner