Age | Commit message (Collapse) | Author |
|
Add tables for Windows-1250, Windows-1251, and ISO-8859-1.
Also add unicode_from_encoding tables.
Move encodings from PDF namespace to Fitz.
|
|
The core library doesn't know where a document comes from, since we can
open it as a stream, etc. Let the viewer handle relative file URLs.
|
|
Don't pass the information as a separate argument.
|
|
|
|
When generating a softmask, which is to be rendered with a blend,
don't pass that blend down into the rendering of the softmask.
Otherwise the blend gets used twice. In the example given this is
causing the content to disappear.
|
|
Extracting embedded files can be trivially done with 'mutool show'
or a simple mutool run script.
The portfolio creation code is incomplete, and would require a lot of
work and testing with Adobe in order to be useful.
|
|
Remove pointless paranoia checks.
Move the check whether it has already been loaded into load_portfolio().
|
|
|
|
|
|
What's the difference between PDF_OBJ_FLAG_MARK and PDF_FLAGS_MARKED?
PDF_OBJ_FLAG_MARK is used to flag an xref entry as one that we want
to keep cached with the pdf_mark_xref/pdf_clear_xref_to_mark functions.
PDF_FLAGS_MARKED is used to detect unwanted recursion in PDF structures.
Renaming the xref_entry.flags field to xref_entry.marked should remove this
source of potential confusion.
|
|
15 years have passed since we first set the sampling to a 32x32 mesh.
Quadrupling it to 64x64 sounds about right to me.
|
|
Since we call end_layer without distinction, we should also call
begin_layer the same way.
Also change the XML to emit separate tags for beginning and ending
a layer, since there is no guarantee the layer calls will be neatly
nested with clipping pushes and pops; nor is there a guarantee that
the PDF will even balance the BMC/BDC and EMC operators.
|
|
|
|
A proper appearance stream is written when signing with a certificate.
This is just to create a placeholder appearance when the original document
did not write one.
|
|
This option is exposed as the -D flag to mutool clean.
Allow saving a document without encryption.
The next step is to allow saving a document with new encryption, but this
may require a fair amount of rejigging since the PDF write code to keep
separate doc->crypt objects for decryption and encryption.
|
|
|
|
Update to match Adobe Reader's behaviour. This fixes bug #700128.
|
|
If running the page throws an exception, we don't need to call end_group since
the page interpretation is aborted and won't be finished.
|
|
The close callback should make sure everything is cleanly shut down.
The drop callback frees leftover memory when shutting down either
cleanly or when aborting processing due to errors.
|
|
|
|
|
|
|
|
|
|
|
|
This covers both the case of no error and a thrown exception.
|
|
|
|
|
|
|
|
Push the clip state, and pass the correct text rendering mode state.
|
|
|
|
|
|
When pdf_dev_pop() is called it will drop the reference to the buffer.
pdf_dev_push_new_buf() will either create a new buffer reference or take a reference to the existing buffer.
When pdf_dev_pop() is called unbalance this creates a problem as the
top level buffer will be unreferenced too many times.
fails-32.pdf
|
|
|
|
The filter op for Tz was reading the scale in and dividing by 100 as we
do elsewhere. The buffer op was then forgetting to multiply by 100
before rewriting it.
|
|
|
|
|
|
|
|
|
|
Drop the unused 'serif' argument to the CJK lookup functions.
Use the BCP 47 names for CJK scripts and languages:
zh-Hant for traditional Chinese,
zh-Hans for simplified Chinese,
ja for Japanese,
ko for Korean.
The lookup function also allows commonly used language+country codes:
zh-TW and zh-HK for traditional Chinese,
zh-CN for simplified Chinese.
|
|
|
|
|
|
pdf_page_transform() may throw due to a cycle in the page tree.
When this happened mupdf would previously forget to drop the
default colorspaces obtained, after this commit they are dropped.
Thanks to oss-fuzz for reporting.
|
|
Not popping causes assert to be triggered in fz_draw_end_group().
|
|
|
|
Not popping causes assert to be triggered in fz_draw_end_group().
|
|
|
|
Previously there was no visibility as to what the error was.
|
|
fz_fill_path() may throw an exception halfway through
pdf_show_path(), which in this case would not attempt to end any
begun groups or softmasks. This led to e.g. leaks of pixmaps held
by a group that was never ended.
Moving the cleanup to the always block is not foolproof because
the cleanup code itself may also throw exceptions, hence
preventing the end of the fz_always block from being executed.
This commit does put pdf_show_path() in the same situation as
pdf_run_xobject() that has the same problem with its cleanup
code.
Thanks to oss-fuzz for reporting.
|
|
fz_open_jbig2d() is called at two locations in MuPDF. At one
location a reference to the JBIG2 globals struct was taken before
passing it to fz_open_jbig2d(). At the other location no such
reference was taken, but rather ownership of the struct was
implicitly transferred to fz_open_jbig2d(). This inconsistency
led to a leak of the globals struct at the first location.
Now, passing a JBIG2 globals struct to fz_open_jbig2d() never
implictly takes ownership. Instead the JBIG2 stream will take a
reference if it needs it and drops it in case of error. As usual
it is the callers responsibility to drop the reference to the
globals struct it owns.
|
|
JBIG2 images are detected by build_compression_params() and then
always passed to fz_open_image_decomp_stream() by build_filter().
Therefore there is no chance for build_filter() at a later stage
to detect JBIG2 images, and so that check can be removed.
|