summaryrefslogtreecommitdiff
path: root/pdf/pdf_annot.c
AgeCommit message (Collapse)Author
2012-07-18Update pdf_to_utf8 to handle either a stream or a stringPaul Gardiner
Also change first argument from fz_context to pdf_document in each of pdf_to_utf8, pdf_to_utf8_name, pdf_to_ucs2 and pdf_to_ucs2_name
2012-07-09Forms: add widget enumeration, and text-widget content typePaul Gardiner
Now reusing the internal representation of an annotation for widgets to avoid two separate lists
2012-07-05Merge branch 'master' into formsRobin Watts
2012-06-25Warning fixes and various clean ups:Sebastian Rasmussen
Remove unused variable, silencing compiler warning. No need to initialize variables twice. Remove initialization of unread variable. Remove unnecessary check for NULL. Close output file upon error in cmapdump.
2012-06-21Forms: permit annotations with no appearance streamPaul Gardiner
We now create pdf_annot objects for PDF annotations even if they have no appearance stream (i.e. even if invisible). That is necessary because even invisible annotations can be targets of user interaction. This is at least a partial fix for bug 693131
2012-06-20Add better mechanism for enumerating annotation rectangles.Robin Watts
Rather than having a dedicated call to enumerate the rectangles for the annotations on a page, add an interface for enumerating annotations with accessor functions. Currently the only accessor function is the one to get the annotation rectangle. Use this new scheme in place of fz_bound_annots within mudraw. Also use this scheme to set the caret cursor in the viewer when over a data field.
2012-06-14Add -j flag to mudraw; create simple mujstest scripts automatically.Robin Watts
We add a new fz_bound_annots function (and associated pdf_bound_annots function) that calls a given callback with the page rectangle of the annotations on a given page. This is marked as being a 'temporary' function, so we can remove it/change it in future if required. It seems likely that we'll want to have some sort of 'iterate over annotations' function eventually, and this does the job for now. Add a -j flag to mudraw that outputs a simple mujstest script. For each page with annotations, the script jumps to that page, then for each annotation on the page, it sets some text to be entered, and clicks the annotation. In the case of text fields, this will cause the text to be entered into that text field; in the case of buttons it will execute the button. At the end of each page with annotations, the script is told to snapshot the page. These test scripts are not designed to be full tests, but they do at least provide an easy way for us to generate scripts where every field in our test suite is interacted with.
2012-05-24Forms: synthesise push button widgetPaul Gardiner
2012-05-08Forms: create apearance streams for text fields when not present in the filePaul Gardiner
2012-05-08Forms: handle field appearance change on mouse up/downPaul Gardiner
2012-03-15Bug 692874: Fix Launch annotations.Robin Watts
Looks like my launch annotation code was incorrect, hence giving the empty string for all FZ_LINK_LAUNCH types; fixed here.
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-06Split fitz.h/mupdf.h into internal/external headers.Robin Watts
Attempt to separate public API from internal functions.
2012-02-26Move fz_obj to be pdf_obj.Robin Watts
Currently, we are in the slightly strange position of having the PDF specific object types as part of fitz. Here we pull them out into the pdf layer instead. This has been made possible by the recent changes to make the store no longer be tied to having fz_obj's as keys. Most of this work is a simple huge rename; to help customers who may have code that use such functions we have provided a sed script to do the renaming; scripts/rename2.sed. Various other small tweaks are required; the store used to have some debugging code that still required knowledge of fz_obj types - we extract that into a nicer 'type' based function pointer. Also, the type 3 font handling used to have an fz_obj pointer for type 3 resources, and therefore needed to know how to free this; this has become a void * with a function to free it.
2012-02-03Add document interface.Tor Andersson
2012-01-27Rename pdf_xref type to pdf_document.Tor Andersson
2012-01-19Use explicit flags rather than bit masks when parsing link destinations.Tor Andersson
2012-01-19Transform link rectangles by the hidden page CTM.Tor Andersson
2012-01-13Simple annotation fixes to avoid infinite recursions.Robin Watts
Thanks to Zeniko for spotting the problem here.
2012-01-06Various fixes to avoid arithmetic problems.Robin Watts
Various fixes to avoid overflow problems, division by zeros, use of uninitialised variables etc. All from/suggested by Zenikos patch.
2011-12-30Correct off by 1 error in outline handling.Robin Watts
When the page number is given by an int, rather than an indirect reference number in a link destination, the page number is already 0 based. Remove the adjustment that I'd been incorrectly doing.
2011-12-30Outline fixesRobin Watts
When reading an XYZ link destination, I was writing Z over X. While fixing this, change to cryptic enums rather than unexplained magic numbers. When reading the outlines out of a pdf file, better to actually store them in a linked list rather than just dropping them.
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-22Fix Bug 692756: SEGVs in pdf_annot and pdf_outlineRobin Watts
A couple of bits of the code SEGV in the event that values are NULL. Fixed here by converting a do...while to a while, and adding an extra guard in the if. Thanks to Gaetan Bisson for the report, and patch.
2011-12-16Add fz_malloc_struct, and make code use it.Robin Watts
The new fz_malloc_struct(A,B) macro allocates sizeof(B) bytes using fz_malloc, and then passes the resultant pointer to Memento_label to label it with "B". This costs nothing in non-memento builds, but gives much nicer listings of leaked blocks when memento is enabled.
2011-12-08Stylistic changes when testing pointer values for NULL.Tor Andersson
Also: use 'cannot' instead of 'failed to' in error messages.
2011-10-04Move to exception handling rather than error passing throughout.Robin Watts
This frees us from passing errors back everywhere, and hence enables us to pass results back as return values. Rather than having to explicitly check for errors everywhere and bubble them, we now allow exception handling to do the work for us; the downside to this is that we no longer emit as much debugging information as we did before (though this could be put back in). For now, the debugging information we have lost has been retained in comments with 'RJW:' at the start. This code needs fuller testing, but is being committed as a work in progress.
2011-09-21Don't thread ctx through safe fz_obj functions.Tor Andersson
2011-09-15Add context to mupdf.Robin Watts
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
2011-09-14Initial import of exception handling codeRobin Watts
Import exception handling code from WSS, modified to fit into the fitz world. With this code we have 'real' fz_try/fz_catch/fz_rethrow functions, handling a fz_except type. We therefore rename the existing fz_throw/ fz_catch/fz_rethrow to be fz_error_make/fz_error_handle/fz_error_note. We don't actually use fz_try/fz_catch/fz_rethrow yet...
2011-09-01Use correct concatenation order for XObject matrix.Tor Andersson
2011-04-14Add fallback case for links accessed by button annotations.Tor Andersson
2011-04-07pdf: Purge unmaintained debug/log printing messages.Tor Andersson
2011-04-04Le Roi est mort, vive le Roi!Tor Andersson
The run-together words are dead! Long live the underscores! The postscript inspired naming convention of using all run-together words has served us well, but it is now time for more readable code. In this commit I have also added the sed script, rename.sed, that I used to convert the source. Use it on your patches and application code.
2011-04-04pdf: Rename mupdf directory.Tor Andersson