summaryrefslogtreecommitdiff
path: root/source/pdf
AgeCommit message (Collapse)Author
2016-07-06Expose LAB colorspaceSebastian Rasmussen
2016-06-30Fix bug when opening small PDF-files.Sebastian Rasmussen
The PDF repair code suffered an buffer index overflow while searching the buffer of file data if the file (and hence the buffer) was sufficiently small. This also happened while attempting to open a path pointing to a directory as they are treated as zero byte files.
2016-06-22Tweak PDF annot API.Robin Watts
The values returned from the pdf_annot_{contents, author, date} functions should not be altered, hence make it const.
2016-06-22Add support for getting additional annotation informationMichael Vrhel
GSView will make use of the details about the annotations including the author, the date and which annotation the annotation is in reply to. This commit provides the interface to do this easily.
2016-06-22Use vertical presentation forms.Tor Andersson
Remap glyphs using presentation form code points rather than having a separate vertical variant of the CJK font using truetype collections. Recreate DroidSansFallback fonts from original source, extend the glyph coverage from DroidSans, subset the glyphs to match CJK CID collections, and optimize the outlines using fontcrunch.
2016-06-21Fix typo due to switching from int to size_t.Sebastian Rasmussen
Commit 4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca introduced a typo when doing the int -> size_t conversion. This caused a coverity warning which is now fixed.
2016-06-20Fix signed/unsigned warning.Robin Watts
2016-06-17Add mediabox argument to fz_new_display_list.Tor Andersson
To return the proper size from fz_bound_display_list, which has been broken since the begin_page device call was removed.
2016-06-17Add device space transform state to draw device.Tor Andersson
Allows us to remove the out parameter 'transform' from fz_begin_page.
2016-06-17Allow PDF strings to be > 16bits.Robin Watts
This stops Bug693111.pdf giving errors.
2016-06-17Use 'size_t' instead of int as appropriate.Robin Watts
This silences the many warnings we get when building for x64 in windows. This does not address any of the warnings we get in thirdparty libraries - in particular harfbuzz. These look (at a quick glance) harmless though.
2016-06-16Add PNG output for mutool convert.Tor Andersson
2016-06-16Return options struct argument from pdf_parse_write_options.Tor Andersson
Makes it easier to chain function calls.
2016-06-16Fix crash due to double closing output in pdf_save_document.Robin Watts
Broken due to refactoring. Thanks to Michael for spotting this.
2016-06-14Fix typos in various parts of the code.Sebastian Rasmussen
2016-06-14Add optional support for Luratech JBIG2 decoder.Sebastian Rasmussen
If thirdparty/luratech is populated then this decoder will be preferred over jbig2dec (even if both are present).
2016-06-13Add pdf_write_document.Robin Watts
Allow us to write a document to an fz_output as opposed to just a filename. We cannot write digital signatures in this method though. Will ponder that in a later commit.
2016-06-13Bug 696822: Refuse to save a pdf file incrementally if it would break.Robin Watts
If a file cannot be saved incrementally, then don't accept that as an option. In practise this means if someone asks to save a file incrementally, and it was repaired, or it uses encryption then throw an error. Add a new function to ask if it's safe to save a file incrementally, and use that in the appropriate places.
2016-06-08Move to using size_t for all mallocs.Robin Watts
This has knock on effects in the store. fix
2016-06-06Add FZ_ENABLE_JS configuration define.Tor Andersson
2016-06-06Minimize the number of CMaps built in to the ones listed in the spec.Tor Andersson
Omitting the unlisted UTF-8 and UTF-32 CMaps saves ~1M. Omitting the unlisted other CMaps saves ~200k. Define CJK_CMAPS=0 to skip all CMaps. Define EXTRA_CMAPS=1 to include the various other CMaps. Define UTF8_CMAPS=1 and UTF32_CMAPS to include the UTF-8 and UTF-32 CMaps.
2016-05-31Bug 696813: Fix Lab colorspaces.Robin Watts
Lab colorspaces had been broken due to incorrect clipping of color values introduced in an effort to fix Bug 696796.
2016-05-24Fix 696796: clamp color values in PDF to valid range.Tor Andersson
2016-05-24fz_pixmap revamp: add stride and make alpha optionalRobin Watts
fz_pixmaps now have an explicit stride value. By default no change from before, but code all copes with extra gaps at the end of the line. The alpha data in fz_pixmaps is no longer compulsory. mudraw: use rgb not rgba (ppmraw), cmyk not cmyka (pkmraw). Update halftone code to not expect alpha plane. Update PNG writing to cope with alpha less input. Also hide repeated params within the png output context. ARM code needs updating.
2016-05-20murun: Add graftObject to javascript bindings.Tor Andersson
Add some paranoid checks to pdf_graft_object to prevent user errors from crashing mupdf.
2016-05-13Add common page range parsing function for tools.Tor Andersson
2016-05-13murun: Add document writer object.Tor Andersson
2016-05-13Fix double free and memory leak.Tor Andersson
2016-05-13Add pdf write support to mutool convert.Tor Andersson
2016-05-13Add long output option parsing.Tor Andersson
Use comma-separated list of flags and key/value pairs, for example: "linearize,resolution=72,colorspace=gray"
2016-05-13Update MuJS.Tor Andersson
2016-05-06Fix pdf_delete_page_range.Robin Watts
And improve the header file commenting.
2016-05-06Mutool clean: Fix sanitisation of pages with Content arrays.Robin Watts
If the Contents of a page are an array, we were forgetting to write the new singleton replacement into the dictionary.
2016-05-06Mutool clean: Copy OCProperties when subsetting.Robin Watts
Otherwise files (such as bug696754.pdf) can go wrong.
2016-04-29muclean: Avoid warning when no Outlines present in document.Robin Watts
2016-04-28Fix JPX breakage caused during refactor.Robin Watts
I was using fz_compressed_image when I should have been using fz_pixmap_image.
2016-04-28Refactor fz_image code cases.Robin Watts
Split compressed images (images based on a compressed buffer) and pixmap images (images based on a pixmap) out into separate subclasses.
2016-04-28Tweak fz_image in preparation for things to come.Robin Watts
Move from ints to bits where possible.
2016-04-28Partial image decode.Robin Watts
Update the core fz_get_pixmap_from_image code to allow fetching a subarea of a pixmap. We pass in the required subarea, together with the transformation matrix for the whole image. On return, we have a pixmap at least as big as was requested, and the transformation matrix is updated to map the supplied area to the correct place on the screen. The draw device is updated to use this as required. Everywhere else passes NULLs in, and so gets unchanged behaviour. The standard 'get_pixmap' function has been updated to decode just the required areas of the bitmaps. This means that banded rendering of pages will decode just the image subareas that are required for each band, limiting the memory use. The downside to this is that each band will redecode the image again to extract just the section we want. The image subareas are put into the fz_store in the same way as full images. Currently image areas in the store are only matched when they match exactly; subareas are not identified as being able to use existing images.
2016-04-27Tweak pdf-write option handling.Tor Andersson
The handling of not-decompressing images/fonts was geared towards pdfclean usage; but now that we can create new PDF files, it makes more sense to ask for images and fonts to be compressed, rather than asking for them not to be decompressed with quirky interaction with the 'expand' and 'deflate' flags. If -f or -i are set, we will never decompress images, and we will compress them if they are uncompressed. If -d is set, we will first decompress all streams (module -f or -i). If -z is set, we will then compress all uncompressed streams.
2016-04-27Add fz_close_device function.Tor Andersson
Garbage collected languages need a way to signal that they are done with a device other than freeing it. Call it implicitly on fz_drop_device; so take care not to call it again in case it has been explicitly called already.
2016-04-27Fix exception bug: rethrow without a caught exception!Tor Andersson
2016-04-27Remove useless try/catch/rethrows.Tor Andersson
2016-04-27Fix 696649: remove fz_rethrow_message calls.Tor Andersson
2016-04-26Improve fz_new_documentRobin Watts
Use a macro to make fz_new_document nicer (akin to fz_malloc_struct).
2016-04-26Change order of arguments to pdf_add_page etc.Tor Andersson
Resources are defined before they are used; so it's only logical to have the resource dictionary before the content buffer in the argument list.
2016-04-26pdfcreate: Use industry font name for built-in fonts.Tor Andersson
2016-04-26Optimize pdf_lookup_agl.Tor Andersson
2016-04-26Update mutool clean sanitize to clean annotations too.Robin Watts
2016-04-22pdf: Handle implicit identity crypt filtersSebastian Rasmussen
Fixes http://bugs.ghostscript.com/show_bug.cgi?id=696687