summaryrefslogtreecommitdiff
path: root/apps/pdfapp.c
AgeCommit message (Collapse)Author
2012-05-15Forms: make forms API separate to the main document APIPaul Gardiner
This also provides a way to test whether interactive methods are supported.
2012-05-08Forms: add text input dialog to win32 appPaul Gardiner
2012-05-08Forms: handle some cases of setting text-field textPaul Gardiner
2012-05-08Forms: part of text field handlingPaul Gardiner
2012-05-08Forms: inhibit "wait" cursor when updating display just for a form changePaul Gardiner
2012-05-08Forms: handle field appearance change on mouse up/downPaul Gardiner
2012-04-20Pass UTF8 filename to fz_open_document / fz_open_file to remove kludges.Tor Andersson
Use _wopen on a UTF8 -> wchar_t decoded filename to support UTF8 filenames for win32.
2012-04-20Update pdf_version to 1.0Robin Watts
2012-04-20Update usage string, and About box.Robin Watts
Add missing options to MuPDF usage string. Ensure windows 'About MuPDF' box is large enough to fit the whole of the usage string in.
2012-04-05Don't unlock a lock we don't own.Robin Watts
While debugging Bug 692943, I spotted a case where we can attempt to unlock the file while we don't hold the file lock due to an error being thrown while we momentarily drop that lock. Simple solution is to add a new fz_try()/fz_catch() to retake the lock in such an error circumstance.
2012-03-28Bump version string to 1.0 release candidate 1.Tor Andersson
2012-03-19Add simple 'inverted color' mode for mupdf viewer.Robin Watts
Use 'i' to toggle inversion of the rendered MuPDF bitmap, giving simple 'white on black' mode.
2012-03-19Bug 692934: Add Zoom to Width/Zoom to Height to MuPDF viewerRobin Watts
Simple fix to pdf app to 'fit width' and 'fit height' on W and H respectively. Thanks to eeva@marvid.fr for the patch.
2012-03-16Allow XPS document to be opened from unzipped _rels/.rels in mupdf app again.Tor Andersson
2012-03-16Bug 692805: BBox rounding issuesRobin Watts
Currently all conversions from rect to bbox are done using a single function, fz_round_rect. This causes problems, as sometimes we want 'round, allowing for slight calculation errors' and sometimes we want 'round slavishly to ensure we have a bbox that covers the rect'. We therefore split these 2 cases into 2 separate functions; fz_round_rect is kept, meaning "round outwards allowing for slight errors", and fz_bbox_covering_rect is added to mean "give us the smallest bbox that is guaranteed to cover rect". No regressions seen.
2012-03-15Bug 692866: Do not add a final newline when cutting/pasting.Robin Watts
Previously MuPDF would add a newline at the end of every line. As requested in the bug, we here avoid adding a final newline. Unlike the suggested patch, we avoid adding one, rather than removing one.
2012-03-14Fix memory leaks in style sheet handling of the new text device.Tor Andersson
2012-03-13Bug 692882 - fix buffer overflow.Robin Watts
Long doctitles (filenames in this case) can cause a buffer overflow. Fix here. Thanks to Hin-Tak and Pavel Zhukov.
2012-03-13Add ctx argument and rename fz_bound_pixmap to fz_pixmap_bbox.Tor Andersson
2012-03-13Rename some functions and accessors to be more consistent.Tor Andersson
Debug printing functions: debug -> print. Accessors: get noun attribute -> noun attribute. Find -> lookup when the returned value is not reference counted. pixmap_with_rect -> pixmap_with_bbox. We are reserving the word "find" to mean lookups that give ownership of objects to the caller. Lookup is used in other places where the ownership is not transferred, or simple values are returned. The rename is done by the sed script in scripts/rename3.sed
2012-03-13Split XPS header. Update Makefile dependencies. Add pixmap w/h accessors.Tor Andersson
2012-03-12Create style sheet and group extracted text into blocks, lines and spans.Tor Andersson
2012-03-07Splitting tweaks.Tor Andersson
2012-03-06Split fitz.h/mupdf.h into internal/external headers.Robin Watts
Attempt to separate public API from internal functions.
2012-02-15Stop searching in viewer when clicking page links.Sebastian Rasmussen
2012-02-07Rename a few functions.Tor Andersson
2012-02-03Free current document page when closing pdf application.Sebastian Rasmussen
2012-02-03Be consistent about passing a fz_context argument in pixmap functions.Tor Andersson
2012-02-03Reference count fz_link objects.Tor Andersson
2012-02-03Use the new document interface in viewer.Tor Andersson
2012-02-03Allow ZIP as extension for CBZ files.Tor Andersson
2012-02-02Support remote links in XPS documents.Robin Watts
Update xps path handling to cope with URLs. Fix premature freeing of links. Spot remote URLs and use appropriate link type.
2012-02-02Work on supporting links in xps documents.Robin Watts
Currently, this only works with local links. When running the page, check for NavigateUri entries; if found, and that page is not already marked as having resolved it's links, add a new link entry to doc->current_page links. When the page finishes running, mark the page as having resolved it's links. This avoids the links being generated multiple times. Update the mupdf viewer to use these links - but only AFTER the page has been run.
2012-01-30Do not embed a context in the fz_outline structure.Tor Andersson
2012-01-30Add CBZ (comic book zip-file) parser.Tor Andersson
2012-01-27Rename pdf_xref type to pdf_document.Tor Andersson
2012-01-19Remove confusing optional 'password' argument to pdf_open_xref.Tor Andersson
Require that clients call pdf_needs_password/pdf_authenticate_password instead. For dumb clients, we still allow for decrypting a file with a blank password without calling those functions.
2012-01-18Add fullscreen mode to mupdf viewer.Tor Andersson
Toggle with 'f'. Fullscreen turns off shrinkwrap, and shrinkwrap turns off fullscreen.
2012-01-12Update copyright notices for 2012.Tor Andersson
2012-01-12Use the same coordinate system for pdf and xps pages in the interface.Tor Andersson
Move coordinate space tweaks into pdf_ and xps_run_page, and provide neutral pdf_ and xps_bound_page functions to return the page size as a zero-origined bounding box.
2012-01-11Add xps_run_page function.Tor Andersson
2012-01-11Hide glyph cache in context.Tor Andersson
2012-01-10Automatically load page tree when accessing a page/page count.Sebastian Rasmussen
2012-01-10Fix many spelling errors.Sebastian Rasmussen
2012-01-04Bug 692739: Add ability to abort time consuming actionsRobin Watts
A new 'cookie' parameter is added to page rendering/interpretation functions. Supply this as NULL to get existing behaviour. If you supply a non-NULL cookie, then this is taken as a pointer to a struct that can be used for simple, non-thread locked communication between caller and library. The entire struct should be memset to zero before entry, except for specific flags (thus coping with future extensions to this struct). The abort flag should be zero on entry. It will be checked periodically by the library - if the caller sets it non-zero (via another thread) then the current operation will be aborted. No guarantees are given as to how often this will be checked, or how fast it will be responded to. The progress_max field will be set to an integer (-1 for unknown) representing the number of 'things' to do. The progress field will count up from 0 to this number as time goes by. No guarantees are made as to the accuracy of this information, but it should be useful for offering some sort of progress bar etc. Note that progress_max may increase during the job. In general, callers should be careful to accept out of range or invalid data in this structure as this is deliberately accessed 'unlocked'.
2011-12-30Load outlines in viewer after pages to allow links to work.Robin Watts
In order for hyperlinks to work, we need to load the outlines after the pages tree.
2011-12-28Outline/link destination tweaks.Robin Watts
Move 'kind' into the fz_link_dest structure (as this makes more sense). Put an fz_link_dest rather than just a page number into the outlines structure. Correct parsing of actions and dests from pdf outlines.
2011-12-23Generalise pdf_links to be fz_links.Robin Watts
Move to a non-pdf specific type for links. PDF specific parsing is done in pdf_annots.c as before, but the essential type (and handling functions for that type) are in a new file fitz/base_link.c. The new type is more expressive than before; specifically all the possible PDF modes are expressable in it. Hopefully this should allow XPS links to be represented too.
2011-12-15Add scavenging functionality.Robin Watts
When fz_malloc (etc) are about to fail, we try to scavenge memory from the store and then retry. We repeatedly try to bin objects from the store until the malloc succeeds, or until we have nothing else to bin. This means we no longer need the 'aging' of the store, so this is removed.
2011-12-15Rework pdf_store to fz_store, a part of fz_context.Robin Watts
Firstly, we rename pdf_store to fz_store, reflecting the fact that there are no pdf specific dependencies on it. Next, we rework it so that all the objects that can be stored in the store start with an fz_storable structure. This consists of a reference count, and a function used to free the object when the reference count reaches zero. All the keep/drop functions are then reimplemented by calling fz_keep_sharable/fz_drop_sharable. The 'drop' functions as supplied by the callers are thus now 'free' functions, only called if the reference count drops to 0. The store changes to keep all the items in the store in the linked list (which becomes a doubly linked one). We still make use of the hashtable to index into this list quickly, but we now have the objects in an LRU ordering within the list. Every object is put into the store, with a size record; this is an estimate of how much memory would be freed by freeing that object. The store is moved into the context and given a maximum size; when new things are inserted into the store, care is taken to ensure that we do not expand beyond this size. We evict any stored items (that are not in use) starting from the least recently used. Finding an object in the store now takes a reference to it already. LOCK and UNLOCK comments are used to indicate where locks need to be taken and released to ensure thread safety.