summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-04-14Split fz_meta into separate querying functions.Tor Andersson
Add fz_has_permission function to fz_document. Add fz_lookup_metadata function to fz_document. Remove fz_meta function from fz_document.
2015-04-14epub: Parse url() tokens.Tor Andersson
Fix bug 695922.
2015-04-09Add convenience make targets: make release and make debug.Tor Andersson
2015-04-09Add -v option to mutool and mudraw to print MuPDF version number.Tor Andersson
2015-04-09Remove the _no_run functions.Tor Andersson
The new pdfclean sanitize functionality mean that mutool now needs the data files, so maintaining the split that was designed to keep data files out of mutool is no longer viable.
2015-04-08Fix mupdf viewer on windows; mousewheel events would stop keys respondingRobin Watts
Mousewheel events would 'capture' the mouse, and consequently all keyboard events would be ignored until the next mouse button up. Simple fix.
2015-04-08Fix windows builds of epub-doc.cRobin Watts
Variables need to be defined at the top of blocks.
2015-04-08Update jbig2dec submodule.Tor Andersson
2015-04-08Update docs/thirdparty.txtTor Andersson
Remove v8 from docs/thirdparty.txt since we use MuJS by default.
2015-04-08Add docs/example.c and docs/multi-threaded.c to 'make examples' target.Tor Andersson
Also update the examples for the recent API changes and make them build under MSVC.
2015-04-08Update documentation with fz_context changes.Robin Watts
2015-04-07Fix whitespace.Tor Andersson
2015-04-07Tweak CHANGES and README for release 1.7.Robin Watts
Update FZ_VERSION to 1.7 Update Android app version.
2015-04-07Add some basic page margins to EPUB layout.Tor Andersson
Add margins of 1 em at the top and bottom of every page at the top level. TODO: This should be set from the CSS using the @page selector, and be collapsed with the body margins at the start and end of each chapter, as well as the left and right body margins.
2015-04-07Fix some warnings.Tor Andersson
2015-04-07Add EPUB layout options to mupdf-x11 and mudraw.Tor Andersson
2015-04-07Trigger default layout in fz_document layer.Tor Andersson
Trigger the default layout when needed, but only if no manual layout has been done. This avoids doing a pointless double layout (once with default when loading the document, then with the manual layout call with the desired layout options).
2015-04-07Rename mutool show 'pages' to 'pagetree' to reduce possible confusion.Tor Andersson
Fixes bug 695909.
2015-04-07Compile windows resource file when building with MinGW.Tor Andersson
2015-04-07Fix structured text extraction in vertical mode.Robin Watts
When advancing a glyph in vertical mode, it should advance down the page. The origin of the glyph as supplied is bottom left, not top right - allow for this in calculations. Previously glyphs were not being collated into spans because of this.
2015-04-07Structured text extraction; improve glyph bounding box calculations.Robin Watts
In vertical motion mode, when calculating bboxes we should use horizontal rather vertical displacements from the 'axis of movement'. In horizontal mode, we displace by 'ascender' and 'descender'. Those concepts don't rotate with the motion mode, so repurpose those fields to hold bbox.x0 and bbox.x1 in vertical mode.
2015-04-07Use fz_advance_glyph rather than direct FT calls during PDF layout.Robin Watts
2015-04-06Add some simple debug code to dump fz_gels.Robin Watts
Just for internal use, no external interface.
2015-04-06Antidropout followup: cope with stroking too.Robin Watts
Stroke segments that are horizontal or vertical get the same antidropout treatment as filled rectangles.
2015-04-06Bug 694367: Attempt to avoid dropouts of rectangles.Robin Watts
This is not a complete general fix for features dropping out of rendered line art, but merely a fix for one of the more common cases. When rendering rectangles (currently, specifically only those rectangles that are actually defined as rectangles within the path structure), if they are axis aligned, then ensure that they always fill the subpixel line they are on.
2015-04-06Bug 693688: MuPDF viewer; if reload fails, don't crash out.Robin Watts
Use a placeholder document instead - just a big red 'X'. Supposedly lots of people use MuPDF to view the output of their TeX documents. Sometimes the compilation of the TeX document fails, and reload results in MuPDF closing. This should allow their window to stay open until they fix the problem and reload again.
2015-04-06Remove gsview from mupdf repo.Robin Watts
It has its own repo now. See http://git.ghostscript.com/?p=gsview.git
2015-04-06Update mutool subtools to use PDF_NAME_xxx rather than "xxx".Robin Watts
2015-04-06Add mutool pages subcommand.Robin Watts
Inspired by bug 695823. Mutool can now dump the sizes and orientations for pages within a given file.
2015-04-06Move the guts of pdfclean into the lib.Robin Watts
Michael needs to be able to call pdfclean from gsview. At the moment he's having to do this by including the pdfclean.c file into the lib build, and then calling pdfclean_main with a faked up command line. This isn't nice. pdfclean.c is implemented by pdfclean_main parsing the options/filenames out of argv and then passing the filenames/options on to a pdfclean_clean function. This seems like a much nicer API to offer to the world. We therefore pull the guts of pdfclean.c (pdfclean_clean and its subsidiary structures/functions) into pdf-clean-file.c and include this in the library build. This leaves pdfclean.c just as the command line parsing. This should not affect the size of any of the resulting binaries.
2015-04-06Fix oddity with pdfinfoRobin Watts
If pdfinfo is invoked as: mutool info file.pdf 1,2,3 then it will show the items found on page 1, then the items found on pages 1 and 2, then the items shown on pages 1,2 and 3. Fix this by clearing the data after each show operation.
2015-04-03Pages created with pdf_create_page were duff.Robin Watts
They hadn't been updated with recent changes. Extract the pdf page creation code from pdf_load_page into a new static function, pdf_new_page, and use that from both places.
2015-04-03Bug 694713: Avoid assert when using pdf_page_writeRobin Watts
When writing a pdf page, we pass page->contents to pdf_new_pdf_device. This object is assumed to be a dictionary (stream) that can be updated with the Length and stream contents once the page writing process has completed. When we are rewriting a pdf page however, this can go wrong; page->contents can be an array of objects. Not only this, in general it would be possible for several pages to share the same page contents (or maybe some of the elements of a page contents array). Updating one page should not update the others. We therefore update pdf_page_write to always create a new page->contents object and use that. Thanks to Michael Cadilhac for spotting the basic problem here.
2015-04-03Bug 693481: Android: Allow panning while zoomingRobin Watts
Adopt (slightly modified) version of Kenny Lam's patch to allow panning while zooming. This more closely matches how a web view behaves.
2015-04-03Bug 694388: Android: Don't call requestLayout more than we need to.Robin Watts
Thanks to Goncalo Ferreira for spotting this.
2015-04-02Bug 695900: pdfclean return code is inverted.Robin Watts
Silly typo. Thanks to Daniel Bloemer for pointing this out.
2015-04-01fix bug #695895. Uninitialized variable in pdf_parse_file_specfredrossperry
2015-04-01Bug 693719: Attempt #2. Broken trailer repair.Robin Watts
Calling pdf_is_dict causes the file to seek. This is a bad thing in a process that is running through the file. It's doubly bad, as the thing it seeks to read may not be there as it might not have been repaired yet. So, instead of just keeping the 'most recent root that is a dictionary', we change to keeping a list of the roots we have found while parsing the doc. At the end we then check for the most recent one that is a dictionary and use that.
2015-04-01Update manpages.Tor Andersson
2015-04-01Fix scan for %d in mudraw.Tor Andersson
2015-04-01Bug 693719: Improve repairing of files with broken trailers.Robin Watts
When repairing a file we keep track of the most recent 'Root' entry we have found. Only accept a new Root entry as a replacement if it is a dictionary.
2015-04-01Clean up mudraw command line syntax.Tor Andersson
... and move outline printing to mutool show.
2015-04-01Fix build for MinGW.Tor Andersson
The pdfapp files live in platform/x11 for both the X11 and win32 builds. Our curl submodule does not build cleanly on MinGW, so skip that variant.
2015-03-31Bug 695457: Improve mouse wheel handling in viewer.Robin Watts
On windows, handle mouse wheel events as mouse events rather than keyboard ones. This means that Ctrl-wheel zooms as expected (consistent with Chrome etc). Also ensure that Shift-wheel changes from vertical to horizontal. Mouse wheel over pages that are larger than fit in the window now scroll around the page. Once they hit the edge of the window, the page flips to the next/previous page as you would expect.
2015-03-30Bug 695892: Fix incremental updates of documents with xref streams.Robin Watts
Simon Reinhardt points out that writexrefstream calls pdf_update_stream on an object, rather than on a reference. The code as written fails to do the update, and the updated file is broken. I fix this here by updating pdf_update_stream to be able to work with both objects and references. This is in contrast to his patch which would create a reference for the sole purpose of performing the update.
2015-03-30Bug 695804: Add support for 'Shift-Space' in the viewer.Robin Watts
Update pdfapp_onkey to take modifiers. If shift is held down when space is sent, then back up a page. This involves updating the windows app to actually send modifiers. Previously they were always sent as zero to the onmouse routine.
2015-03-30Add header for waitpid().Tor Andersson
2015-03-30Bug 695549: Avoid returning compressed buffer as uncompressed.Robin Watts
pdf_load_image_stream is supposed to return a buffer containing the uncompressed stream from an object (or, in the case of image streams where an fz_compression_params structure is supplied, a stream decompressed up to the point of the image format compression). We have an optimisation in pdf_load_image_stream to allow it to return the existing buffer from a cached object rather than reloading it again, but as bug 695549 points out, this breaks in the case where the cached stream is compressed. The suggested fix by the bug reporter (Stefan Klein) would work in that it would stop compressed streams being returned as uncompressed ones, but it is not perfect as it could lead to several copies of shortstoppable image streams being loaded (and for streams with null or empty array filters being mistaken for compressed ones). The fix here solves these cases too.
2015-03-30Bug 695829: Mouse buttons flip pages in presentation mode.Robin Watts
Adopt patch from Risto Saarelma. When in presentation mode, left and right mouse buttons flip pages forward/back.
2015-03-30Bug 695556: Use doubles when inverting matrices.Robin Watts
When inverting matrices, use doubles for inversion calculations. This prevents floats over/underflowing and causing stroked content to go missing.