Age | Commit message (Collapse) | Author |
|
min is a windows only define.
|
|
All of the group are updated which can make them act like radio buttons
in the case that all have different "on" values
|
|
Some fields have separate widget annotations. Some have the widget rolled
in. This commit correctly identifies the field when setting the field value,
thus fixing bug 693145
|
|
|
|
Currently pdf_lexbufs use a static scratch buffer for parsing. In
the main case this is 64K in size, but in other cases it can be
just 256 bytes; this causes problems when parsing long strings.
Even the 64K limit is an implementation limit of Acrobat, not an
architectural limit of PDF.
Change here to allow dynamic buffers. This means a slightly more
complex setup and destruction for each buffer, but more importantly
requires correct cleanup on errors. To avoid having to insert
lots more try/catch clauses this commit includes various changes to
the code so we reuse pdf_lexbufs where possible. This keeps the
speed up.
|
|
Avoid overflowing fz_buffer_printf by using a dedicated string
output function; this also solves potential problems with us not
escaping chars in strings correctly.
Unfortunately this doesn't completely cure the bug as we run
straight into problems in the lexer.
|
|
This fixes bug 693126
|
|
|
|
|
|
This fixes the problem with the test file in bug 693125, although it
doesn't make radio buttons act correctly. The file, rather than using
radio buttons, was actually using check boxes with a reset-form action
to achieve the exclusivity.
|
|
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
|
|
Mostly char * <-> unsigned char * conversions.
|
|
Remove the shim indirection layer for fz_document. A little less type
safe, but a lot less boiler plate.
|
|
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.
|
|
Add/Remove a few consts to pacify MSVC.
|
|
Refactor the text-widget updating code to use the later-written, button-updating
technique, which accounts for rotation. Also now delays generation of
appearance streams until required for rendering.
|
|
|
|
Currently we were attempting to load the javascript for a document
immediately on opening it. Here we delay it until 1) the encryption
for a document has been loaded, and 2) any repair required to a
document has been done.
This solves various problems, which were leading (indirectly) to bug
693128.
|
|
Fix one pdf_js function that didn't protect agains doc->js == NULL.
Also change exception handling in pdf_new_js so that it doesn't
abort just because of a single failed stream load.
|
|
|
|
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.
|
|
Testing tests_private/v1.3/09+20anim+20fx-fo-dx-adr-mx.pdf with
mujstest shows an infinite loop due to an initialisation that
uses FLT_MAX rather than INT_MAX.
Even using INT_MAX still shows problems until a cast is added.
|
|
These functions currently call pdf_array_put, but this fails to
extend the array. Change to use pdf_array_push instead.
|
|
|
|
|
|
Conflicts:
fitz/fitz-internal.h
fitz/stm_buffer.c
pdf/mupdf-internal.h
|
|
|
|
|
|
|
|
After commit 120dadb, it's far too easy to get into a seemingly infinite
loop while processing a corrupt file.
We fix this by changing the process to abort when we receive an invalid
keyword.
Also, we add another layer of nesting to pdf_run_stream to avoid us
push/popping an fz_try level on every keyword.
|
|
The file supplied with the bug contains corrupt jpeg data on page
61. This causes an error to be thrown which results in mudraw
exiting.
Previously, when image decode was done at loading time, the error
would have been thrown under the pdf interpreter rather than under
the display list renderer. This error would have been caught, a
warning given, and the program would have continued. This is not
ideal behaviour, as there is no way for a caller to know that there
was a problem, and that the image is potentially incomplete.
The solution adopted here, solves both these problems. The fz_cookie
structure is expanded to include a 'errors' count. Whenever we meet
an error during rendering, we increment the 'errors' count, and
continue.
This enables applications to spot the errors count being non-zero on
exit and to display a warning.
mupdf is updated here to pass a cookie in and to check the error count
at the end; if it is found to be non zero, then a warning is given (just
once per visit to each page) to say that the page may have errors on it.
|
|
|
|
Also consolidate text widget info, plus general tidying
|
|
Previously measured by rendering to the bounding box device
|
|
Conflicts:
fitz/doc_document.c
fitz/fitz-internal.h
fitz/fitz.h
fitz/stm_buffer.c
pdf/mupdf-internal.h
pdf/pdf_object.c
pdf/pdf_xobject.c
pdf/pdf_xref.c
win32/mupdf.sln
|
|
|
|
Extend mupdfclean to have a new -l file that writes the file
linearized. This should still be considered experimental
When writing a pdf file, analyse object use, flatten resource use,
reorder the objects, generate a hintstream and output with linearisaton
parameters.
This is enough for Acrobat to accept the file as being optimised
for Fast Web View. We ought to add more tables to the hintstream
in some cases, but I doubt anyone actually uses it, the spec is so
badly written. Certainly acrobat accepts the file as being optimised
for 'Fast Web View'.
Update fz_dict_put to allow for us adding a reference to the dictionary
that is the sole owner of that reference already (i.e. don't drop then
keep something that has a reference count of just 1).
Update pdf_load_image_stream to use the stm_buf from the xref if there
is one.
Update pdf_close_document to discard any stm_bufs it may be holding.
Update fz_dict_put to be pdf_dict_put - this was missed in a renaming
ages ago and has been inconsistent since.
|
|
|
|
Add to DOM field borderStyle and buttonSetCaption
Introduce event object
Add border helper object
Fix v8 problem to do with access to external pointers
|
|
|
|
Needs more work to use the linked list of free xref slots.
|
|
|
|
The calc.pdf specific version of pdf_jsimp is no longer needed and hence
dropped.
|
|
|
|
This also provides a way to test whether interactive methods
are supported.
|
|
Make a separate constructor function that does not link in the
interpreter, so we can save space in the mubusy binary by not
including the font and cmap resources.
|
|
|
|
|
|
mupdfclean (or more correctly, the pdf_write function) currently has
a limitation, in that we cannot renumber objects when encryption is
being used. This is because the object/generation number is pickled
into the stream, and renumbering the object causes it to become
unreadable.
The solution used here is to provide extended functions that take both
the object/generation number and the original object/generation
number. The original object numbers are only used for setting up the
encryption.
pdf_write now keeps track of the original object/generation number
for each object.
This fix is important, if we ever want to output linearized pdf as
this requires us to be able to renumber objects to a very specific
order.
We also make a fix in removeduplicateobjects that should only
matter in the case where we fail to read an object correctly.
|
|
Currently, if a page stream cannot be read, mupdf gives an alert box
and then exits. This is annoying when reading a large pdf.
Here we change the code to only exit if a page is completely broken;
in the case of missing page contents, or missing links, we give a warning
and just render the best we can.
Also, update a couple of error messages to be less misleading.
|