Age | Commit message (Collapse) | Author |
|
On the whole we avoid using const within MuPDF, but bug 693350
highlights cases where this can cause a problem with C++.
In C, if you do: foo("bar"); then "bar" has type char *.
In C++, if you do foo("bar"); then "bar" has type const char *.
This means that any calls to the MuPDF library from C++ that take
strings give warnings.
The fix is simple, so it seems to be worthwhile adding a few consts.
None of our internal data structures are affected in any way by
this change.
Thanks to Franz Fellner for pointing out this issue.
|
|
This reduces memory use by another 10% on the 2 testfiles mentioned
in the previous commit (see bug 693330).
|
|
Refactor 'short stopped' image stream loading into fz_compressed_buffer
loading. Nicer overall, and reflects the fact that this can be used
for non-image streams that we want to hold compressed in memory (for
instance for shading streams).
This is a preparatory step for pdfwrite, and enables further shading
memory use optimisations.
Remove unused jbig2 function pointer from the fz_compression_params
(previously fz_image_params) structure to avoid confusion.
|
|
Thanks to Sebras for pointing out our schitzophrenia here.
|
|
The rest of the shading code and source code for other cases already handles
malformed entries in the same way.
|
|
|
|
Currently, the mupdf code loads shadings at parse time, and
instantly decomposes them into a mesh of triangles. This mesh
of triangles is the transformed and rendered as required.
Unfortunately the storage space for the mesh is typically much
greater than the original representation.
In this commit, we move the shading stream parsing/decomposition
code into a general 'fz_process_mesh' function within res_shade.
We then grab a copy of the buffer at load time, and 'process'
(decompose/paint) at render time.
For the test file on the bug, memory falls from the reported 660Mb
to 30Mb. For another test file (txt9780547775815_ingested.pdf
page 271) it reduces memory use from 750Meg to 33Meg. These figures
could be further reduced by storing the compressed streams from the
pdf file rather than the uncompressed ones.
Incorporating typo fix and unused function removal from Sebras. Thanks.
Remove unused function in shading code
|
|
|
|
|
|
|
|
app.execDialog looks very difficult to support. Hopefully we wont have to
|
|
The name of the menu item is passed, so presumably the app could respond
to some of the possibilities.
|
|
The default is to embed the full font.
|
|
This makes no difference to the current operation of the code, but
ensures that 'saner' values are put into the image_params structure.
This will help pdfwrite give more aesthetically pleasing output later.
|
|
Currently the app windows app responds with a message box explaining that
the MuPDF library passes print requests to the app, but the app does not
implement printing.
|
|
|
|
|
|
If the 'fields' parameter is not present then all fields should be reset
|
|
|
|
|
|
Three alterations:
We were previously being careful to avoid throwing exceptions in
the DOM-implementation callbacks because these were being called
directly from C++. This commit adds three veneers that turn exceptions
into warnings, hence allowing the callbacks to be written in usual
mupdf style.
Protect the "field" callbacks from executing with a NULL field.
Ensure that the event object is set up before executing A actions
|
|
Does the same as pdf_dict_puts, but guarantees to always drop the
value passed in (even if the function throws an error). This
allows calling code to have a much simpler life in some cases.
Update pdf_write to make use of this.
Also, fix pdf_dict_puts so it doesn't leak the key object that it
creates in the event of an error while growing the dictionary.
|
|
And add a flag in the xref for evey PDF document to say whether it
has been localised or not; this will be important for PDF editing to
avoid us having to localise on every edit.
|
|
|
|
|
|
Print a warning instead and ignore the soft mask
|
|
Fixes http://bugs.ghostscript.com/show_bug.cgi?id=693314
|
|
Conflicts:
pdf/pdf_xref_aux.c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Conflicts:
cbz/mucbz.c
pdf/pdf_parse.c
pdf/pdf_form.c
xps/xps_zip.c
|
|
Use a "magic" string for filetype detection: filename or mime-type.
|
|
|
|
This was necessary to avoid indirecting through a NULL pointer returned
from pdf_js_get_event, but is a generally sensible restriction.
Also separate the execution of the document-level javascript actions
from the pdf_js contstructor, so that doc->js is set during those
actions.
Also add a missing const
|
|
Should have been pdf_new_name ever since the pre 1.0 rename, but
evidently we missed it.
|
|
Mountian Lion causes various different warnings to be given,
possibly because a change to clang by default. Fix them here.
|
|
pdf_to_utf8 had been updated in an earlier commit, so it was sufficient
to remove the object-type test. Also added a neglected fz_var.
|
|
|
|
Not handling pdf_jsimp_toString returning NULL
Throwing C exceptions in a call issued by v8
Iterating a pointer later used to free a buffer
|
|
|
|
Also fix some uses of null.length
|
|
|
|
|
|
|
|
|