Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Previously the default color of ink annotations was red, but
according to the pdf specification the default color should be
colorless transparent if no color is given.
|
|
Call fz_append_string instead of fz_append_printf for static strings.
Call fz_write_string instead of fz_write_printf for static strings.
|
|
Rename fz_write to fz_write_data.
Rename fz_write_buffer_* and fz_buffer_printf to fz_append_*.
Be consistent in naming:
fz_write_* calls write to fz_output.
fz_append_* calls append to fz_buffer.
Update documentation.
|
|
|
|
Move the definition of the structure contents into new fitz-imp.h
file. Make all code outside of fitz access the buffer through the
defined API.
Add a convenience API for people that want to get buffers as
null terminated C strings.
|
|
|
|
Use a flag in the pdf_annot struct instead.
Don't pass pdf_document to annotation edit functions.
|
|
Put them in the PDF name space and separate words with underscores.
Remove redundant namespace prefixes in java constants.
Device.FLAG_MASK rather than Device.FZ_DEVFLAG_MASK.
Use namespace for PDF annotation flag enum.
|
|
|
|
Closing a device or writer may throw exceptions, but much of the
foreign language bindings (JNI and JS) depend on drop to never throw
an exception (exceptions in finalizers are bad).
|
|
|
|
|
|
The "contents" field is the same as the "obj" field, so can also be
removed.
|
|
|
|
|
|
|
|
|
|
|
|
We want to turn pdf_page into a thin wrapper around a pdf_obj, so that
any updates to the underlying PDF objects will be reflected without
having to reload the pdf_page.
|
|
The generation number is only needed for decryption, and is assumed
to be zero or irrelevant for all other uses.
Store the original object number and generation in the xref slot, so
that we can decrypt them even when the objects have been renumbered,
without needing to pass the original object number around through
the stream loading APIs.
|
|
To return the proper size from fz_bound_display_list, which has been
broken since the begin_page device call was removed.
|
|
This silences the many warnings we get when building for x64
in windows.
This does not address any of the warnings we get in thirdparty
libraries - in particular harfbuzz. These look (at a quick
glance) harmless though.
|
|
|
|
Resources are defined before they are used; so it's only logical to
have the resource dictionary before the content buffer in the argument
list.
|
|
And use the same enum for both the internal bidi code and the layout code.
|
|
Add an explicit 'page setup' matrix to pdf-write device, which is only used
when creating top level page content stream and not the child annotation
content streams.
|
|
|
|
"Defined but not used" and "Set but not used" as seen with
ndk-build.
|
|
Add code to convert to and from fz_text_language codes from
ISO 639 language strings. No validation is carried out.
|
|
We move to using bidirectional "levels" throughout. This should
give us better behaviour vis-a-vis nested l2r/l2r text. This
also allows us to carry xps levels throughout with no loss of
information.
This also avoids the need to special case numbers.
We accordingly carry more information into fz_text.
As well as wmode, also hold additional details about the text spans.
We now include the directionality of the bidi level text (either as
derived from bidi code, or from the original document (e.g. xps)),
the directionality of text (as specified in the original document
(e.g. html)), and the language of the text (if specified in the
original document).
|
|
|
|
|
|
Match naming of fz_moveto/lineto etc for paths.
|
|
|
|
|
|
|
|
|
|
|
|
arrays
The list box and combo box can have values that are 2-element arrays. The first element
is the "export" value and the second element is the value that should be shown
in the list box UI. This fix ensures that we get the proper value to show in the UI.
Also, it adds the option to get the export values. These are needed if you wish to
update the field dictionary's V (value) entry, which is the currently selected values(s).
This fix works well with gsview. The other viewers will now display the proper content
in their UI, (unlike before this fix) but may need a bit more work to ensure that the
proper V (value) is updated with changes in the selections. In addition, we add
selection rectangles to the selected list box items.
|
|
|
|
Currently, every PDF name is allocated in a pdf_obj structure, and
comparisons are done using strcmp. Given that we can predict most
of the PDF names we'll use in a given file, this seems wasteful.
The pdf_obj type is opaque outside the pdf-object.c file, so we can
abuse it slightly without anyone outside knowing.
We collect a sorted list of names used in PDF (resources/pdf/names.txt),
and we add a utility (namedump) that preprocesses this into 2 header
files.
The first (include/mupdf/pdf/pdf-names-table.h, included as part of
include/mupdf/pdf/object.h), defines a set of "PDF_NAME_xxxx"
entries. These are pdf_obj *'s that callers can use to mean "A PDF
object that means literal name 'xxxx'"
The second (source/pdf/pdf-name-impl.h) is a C array of names.
We therefore update the code so that rather than passing "xxxx" to
functions (such as pdf_dict_gets(...)) we now pass PDF_NAME_xxxx (to
pdf_dict_get(...)). This is a fairly natural (if widespread) change.
The pdf_dict_getp (and sibling) functions that take a path (e.g.
"foo/bar/baz") are therefore supplemented with equivalents that
take a list (pdf_dict_getl(... , PDF_NAME_foo, PDF_NAME_bar,
PDF_NAME_baz, NULL)).
The actual implementation of this relies on the fact that small
pointer values are never valid values. For a given pdf_obj *p,
if NULL < (intptr_t)p < PDF_NAME__LIMIT then p is a literal
entry in the name table.
This enables us to do fast pointer compares and to skip expensive
strcmps.
Also, bring "null", "true" and "false" into the same style as PDF names.
Rather than using full pdf_obj structures for null/true/false, use
special pointer values just above the PDF_NAME_ table. This saves
memory and makes comparisons easier.
|
|
|
|
When watermarking, we may want to use the PDF device on an
existing buffer. In this case, we have no 'contents' object.
|
|
Purge several embedded contexts:
Remove embedded context in fz_output.
Remove embedded context in fz_stream.
Remove embedded context in fz_device.
Remove fz_rebind_stream (since it is no longer necessary).
Remove embedded context in svg_device.
Remove embedded context in XML parser.
Add ctx argument to fz_document functions.
Remove embedded context in fz_document.
Remove embedded context in pdf_document.
Remove embedded context in pdf_obj.
Make fz_page independent of fz_document in the interface.
We shouldn't need to pass the document to all functions handling a page.
If a page is tied to the source document, it's redundant; otherwise it's
just pointless.
Fix reference counting oddity in fz_new_image_from_pixmap.
|
|
Rename fz_close to fz_drop_stream.
Rename fz_close_archive to fz_drop_archive.
Rename fz_close_output to fz_drop_output.
Rename fz_free_* to fz_drop_*.
Rename pdf_free_* to pdf_drop_*.
Rename xps_free_* to xps_drop_*.
|
|
Disallow modification of shared fz_path and fz_text objects.
They should follow a create once, consume often pattern, and as such should
be immutable once created.
|
|
Split functions out of pdf-form.c that shouldn't be there, and make
javascript initialization explicit.
|