Age | Commit message (Collapse) | Author |
|
pdf_dict_put_dict creates a new empty dictionary, inserts it
into the parent dictionary, and returns a borrowed reference to it.
These functions should simplify document creation by removing the
need to wrap creation with try/catch for reference counting cleanup.
|
|
_WIN32 is always defined on windows (it means the WinAPI is available).
_WIN64 is also defined on 64-bit targets.
This means the test for defined(_WIN32) || defined(_WIN64) is redundant,
since if _WIN64 is defined, then _WIN32 is always also defined.
MSC_VER is only defined for MSVC, so split the ifdef sections in
include/fitz/system.h into separate MSVC and WIN32 parts so that
we can build with MinGW and other non-MSVC compilers on windows.
|
|
Filter out Link and Popup annotations.
Links are not comments, popup annotations are auxiliary information
for other annotations, so neither of these types should be present
in our list of annotations, but all other annotations should be there,
whether they have appearance streams or not.
Ensure has_new_ap is zero when first loaded, and changed if either
the active AP object is changed or the current AP content stream
is updated.
|
|
Previously crypt->len / 8 could be 0..32. In the case
of crypt->len == 256 this meant that when an 16 byte
MD5 was computed, uninitalized key data would be
accessed because 32 bytes of key data was accessed.
Now crypt->len / 8 is limited to 0..16. So when the
16 byte MD5 is computed and later accessed only the
initialized part of the key data is accessed.
Because crypt->len / 8 is now limited to 0..16 the key
data buffer can also be shrunk to 16 bytes without
risking the code stepping over its boundaries.
|
|
pdf_authenticate_user_password() now looks similar to
pdf_compute_user_password(), easing readability.
|
|
|
|
If a widget DR is missing the font name given in the DA, create a new
simple font for it.
|
|
Don't create a useless pdf_font_desc when writing font resources.
Simplify reference counting by using fewer intermediate variables.
|
|
Use KOI8-U for Cyrillic, and ISO 8859-7 for Greek.
Use with 'mutool create' using an extra argument to the %%Font directive:
%%Font TmRmC Times-Roman Cyrillic
BT
/TmRmC 16 Tf 10 10 Td
<fa c4 d2 c1 d7 d3 d4 d7 d5 ca d4 c5 21> Tj
ET
The alternatives are "Latin", "Greek", and "Cyrillic".
|
|
Create a non-embedded CJK font using UTF-16 encoding. This can be used
in mutool create like so:
%%CJKFont Ming GB1
BT
/Ming 10 Tf
100 100 Td
<4F60 597D> Tj
ET
|
|
|
|
|
|
|
|
|
|
The Border property is long since deprecated.
|
|
|
|
Patterns and XObjects can have their own resource dictionaries.
If they do, use those in preference to the page ones when
filtering.
|
|
|
|
Just use the pdf_obj directly.
Revise ap_iteration and split annot->dirty into separate flags.
One flag for needs_new_ap, and one for has_new_ap (to be used by
clients who may have cached a rendered annotation).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Avoids the silliness of fz_annot_type pdf_annot_type().
|
|
|
|
|
|
|
|
Adds a requirement on the caller to free the returned strings.
|
|
|
|
|
|
|
|
Only attempt to progress to new page tree nodes if a new node to
process has actually been found. Previously if e.g. doc.findPage(1)
was called in murun for a single page document the error message was
"cycle in page tree" because the single page tree node was visited
twice. Now the error message is "cannot find page 1 in page tree",
which is more accurate.
|
|
Call these from the PDF interpreter. Make the DisplayList and
Trace devices cope.
Use these in the SVG output device.
|
|
Don't use directly loaded objects; since the image code assumes
that you always use an indirect reference to the dictionary/stream.
|
|
Previously mupdf would attempt to load any indirect reference,
whether it was a stream or not.
|
|
Previously the JBIG2 globals object might be indirect and if that
reference pointed to the object containing the stream itself then
mupdf would recurse until running out of error stack. Thanks to
oss-fuzz for reporting.
|
|
|
|
Events such as mouse up/down can cause a change to the appearance of a
widget annotation. That the change has happened is flagged by incrementing
the iteration count of the appearance stream. The widget is then recognised
as dirty when the ap_iteration value, stored in the pdf_widget structure,
differs from the appearance stream's actual iteration.
This commit removes a line of code that wrongly reset the iteration to 1
each time load_or_create_form was called, hence masking the widget being
dirty.
|
|
|
|
It should only return true for indirect references that are actually
streams, not just any array/dict that is contained in a stream object.
|
|
length.
|
|
|
|
|
|
Previously, while at the very last glyph mupdf would allocate a
new array for a run of distinct glyph widths and then not drop it
while leaving the function. Now a new run of font widths is only
started if not at the very last glyph.
|
|
|