Age | Commit message (Collapse) | Author |
|
|
|
The signer object now has an extra method that informs the caller of
the maximum size the digest might be. This is used to allocate space for
the digest within the file and to size some of the buffers used in the
code.
The openssl-based inplementation of the signer object has been updated to
perform a test digest generation so as to find the size needed. We
believe that the digest size is indendent of the hashed data.
|
|
Avoid pdf_pass_event interacting with widgets that have the read-only
field set.
|
|
Commit f533104 accidentally removed the line that updated the value
variable.
Also set the field value to a name object for check boxes and radio
buttons, as per the specification.
|
|
pdf_pass_event iterates through the annotations to find one with a
bounding box that encompasses the event point. We were choosing the first
found, whereas later annotations are considered above earlier ones so we
should be choosing the last found.
|
|
Just a case of fixing some incorrect logic.
|
|
This fixes part of bug #699577.
The keystroke event was preventing form fields being cleared, which is
presumably not intended behaviour.
|
|
|
|
|
|
pdf_get_inheritable also looks in trailer/Root/AcroForm for missing keys,
but this behavior is not supported by anything in the specification.
|
|
Use separate functions to keep the code simpler.
Use memmem to simplify and optimize search for 'endstream' token.
Do not look for 'endobj' since that could cause a false positives in
compressed object streams that have duff lengths.
|
|
The intent is for a user to iterate over the annotations on a page calling
pdf_update_annot for each one. If this function returns true, then the
annotation has changed since the last time it was called, and the user
needs to re-render.
pdf_update_page is a simple loop over the annotations on a page, for use
if you only care about page level granularity.
Users should no longer look at or change the pdf_annot.has_new_ap field.
|
|
The intent with the previous code was to default to black
upon unsupported number of components in the color array.
The code however first set all components to zero then to
the value of the first component of the color array. Now
the code follows the original intent.
|
|
|
|
Several things irk me about passing values as const pointers:
* They can be NULL, which is not a valid value.
* They require explicit temporary variables for storage.
* They don't compose easily in a legible manner, requiring
weird pointer passing semantics where the variable being assigned
is hidden as an argument in the innermost function call.
* We can't change the value through the pointer, requiring yet more
local variables to hold copies of the input value.
In the device interface where we pass a matrix to a function, we often
find ourselves making a local copy of the matrix so we can concatenate
other transforms to it. This copying is a lot of unnecessary busywork
that I hope to eventually avoid by laying the groundwork with this
commit.
This is a rather large API change, so I apologize for the inconvenience,
but I hope the end result and gain in legibility will be worth the pain.
|
|
|
|
Removes the need to alloc/free text strings in the API, allowing
for simple functions like pdf_dict_get_text_string.
|
|
|
|
Now handles more annotation types, and does not use the pdf-write device.
Handles many of the usual annotation properties, such as border width,
color, interior color, line ending styles.
* Ink
* Highlight, Underline, Strike-Out, Squiggly
* Line (with arrow-heads)
* Polygon
* PolyLine
* Square
* Circle
* Caret
* Text (needs better icons)
* FileAttachment (needs better icons)
* Sound (needs better icons)
* Stamp
* FreeText
Partially complete:
* Widget (treats everything like a plain text field)
Not done, but on the to-do list:
* /BS style (solid/dashed/bevel/inset/underline)
* /BS dash pattern
Not done and not on the list:
* Movie
* Screen
* Printer's Mark
* Trap Network
* Watermark
* /Border corner radii (ignored by acrobat)
* /BE cloudy border effect
|
|
|
|
|
|
Also remove useless pdf_new_null and pdf_new_bool functions.
Use the PDF_NULL, PDF_TRUE, and PDF_FALSE macros instead.
|
|
Add a PDF_NAME(Foo) macro that evaluates to a pdf_obj for /Foo.
Use the C preprocessor to create the enum values and string table
from one include file instead of using a separate code generator tool.
|
|
|
|
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).
|
|
Adds a requirement on the caller to free the returned strings.
|
|
|
|
|
|
Rather than provide a stream and an explicitly defined set of byte ranges
within that stream, provide a stream that gives access to just the bytes in
the ranges.
|
|
Previously, pdf-pkcs7.c contained mishmash of functions required
for creating and checking signatures, with no separation between
the parts relating to pdf and those relating to pkcs7. This
commit introduces pdf_signature.c which contains the pdf
specifics, leaving pdf-pkcs7.c to be purely pkcs7 functions.
This should more easily allow the use of pkcs7 solutions other
than openssl. The pkcs7 api is declared in pdf-pkcs7.h. It is
entirely free of mupdf specifics, other than using an fz_stream
to specify the bytes to be hashed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Don't try handling them both as links and form widgets.
|
|
All seen in MSVC, mostly in 64bit builds.
|
|
The stream loading is used only by the JS code loading.
|
|
|
|
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.
|
|
Getting a backtrace out with missing functions makes the
backtrace much less useful. Some backtrace routines (such
as that used by Memento on Android) are incapable of
resolving static functions.
We therefore provide 2 scripts (scripts/destatic.sh and
scripts/restatic.sh) that respectively remove and replace
the 'static' from function definitions.
The scripts do not affect "static inline" or "static const"
definitions, and they are are restricted to working in the
source directory (excluding source/tools), thirdparty/mujs
and the platform/{java,android} directories.
The transformed source should NOT be checked in.
To avoid problems with clashing symbols, some functions are
renamed or tweaked slightly in this patch.
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
This has caught a couple of oddities...
|