Age | Commit message (Collapse) | Author |
|
|
|
|
|
According to Google Plays automated crash detection, we get a
NullPointerException when trying to parse a null string as a
Uri.
This turns out to be caused by us trying to open a PDF attachment
from gmail. This is because MuPDF is invoked with a content:// URL
that does not have a file associated with it. Instead we can open
that URL as an InputStream.
Here we amend MuPDF to spot that case, and to open the InputStream,
suck the data into a byteArray, and then to use that to open the
file from.
|
|
Due to a clash on Google Play, we need to rename the apps main
class from com.artifex.mupdf to something else. We choose
com.artifex.mupdfdemo. Any user of the code in their own app
should rename it similarly. To simplify this process we add
some macros in the C.
Various renames and lots of tedious package name editing is still
required in the Java though.
|
|
|
|
|
|
Remove unnecessary hitPageLink method from MuPDFCore and extend the
handling of external links to the java classes
|
|
|
|
This solves the android build SEGVing on xps files such as
ECMA-288.xps.
|
|
|
|
Previously, we had assumed that we'd only ever have one MuPDFActivity
running at once; this meant that we only had a single MuPDFCore, and
that it was safe to hold the native libraries state in global
variables.
Unfortunately, it seems that if you launch MuPDF from the apps list,
and open a file, then return to the home screen using 'Home' rather than
'Back', MuPDF is kept running in the background. Launching a PDF file
from a file manager then starts a new MuPDFActivity and things get
very confused.
The solution implemented here is first to move all the MuPDF global
variables into a 'globals' structure, and update the code to use
this. Next, we allocate this structure on 'openFile', and free it on
'destroying'. Finally, we return the pointer to this structure as a
java long from openFile, and store it in a private data pointer,
globals.
Each MuPDFCore native method can then retrieve the value of 'globals'
and get the global state back. This means that every MuPDFCore native
method must now be non-static (except isJavascriptSupported).
|
|
|
|
|
|
Missed from previous commit.
|
|
|
|
By manually inserting a literal pool, we can avoid the need to
split draw_simple_scale.c out.
|
|
Forgot to add a new file to git.
|
|
Requires android-ndk-profiler to be copied into android and android/jni.
Also requires r8c of the NDK.
|
|
|
|
|
|
|
|
Also add more detail to debug output
|
|
|
|
|
|
|
|
Regenerate dirty appearance streams and report changed annotations since
last call.
Also include a partial revert of changes in 96f335bc, that turn out not
to be necessary.
fz_update_page must now be called between each document-changing event and
the next render. pdfapp.c and the android app have been updated to do so,
but do not yet take advantage of the possibility to render only the updated
areas of the screen.
|
|
|
|
Add pdf_update_annot, which is called before rendering an annotation, and
checks that the annotation structure has correct information. There are
three reasons the information can be out of date.
Attributes of a field may have been changed such that its appearance
stream needs updating. In this case the field will have have "Dirty"
added to its dictionary
The mouse may have changed state over the field, and a different
appearance stream needs selecting. The annotation structure now records
the mouse states for which the current appearance stream is acceptable.
The field may have changed state as recorded by its "AS" value, and a
different appearance stream needs selecting.
|
|
|
|
Also add a function to report whether the core has javascript support,
so that the additional features can be enabled only when the javascript
engine is present
|
|
|
|
Files had been added to project, but not to android makefiles.
Thirdparty file paths needed updating in android makefiles.
Rebuilding with the latest ndk (r8b) shows a problem due to a
bug in the NDK. Work around this.
|
|
|
|
|
|
|
|
Make a separate constructor function that does not link in the
interpreter, so we can save space in the mubusy binary by not
including the font and cmap resources.
|
|
|
|
|
|
|
|
|
|
Bring up to date with current APIs, including text device changes.
|
|
Debug printing functions: debug -> print.
Accessors: get noun attribute -> noun attribute.
Find -> lookup when the returned value is not reference counted.
pixmap_with_rect -> pixmap_with_bbox.
We are reserving the word "find" to mean lookups that give ownership
of objects to the caller. Lookup is used in other places where the
ownership is not transferred, or simple values are returned.
The rename is done by the sed script in scripts/rename3.sed
|
|
This adds XPS and CBZ support for free.
|
|
|
|
File references escaped deletion in previous commit.
|
|
|
|
I forgot to update Android and iOS projects with the extra
arg to fz_new_context. Fixed here.
|
|
|
|
|
|
|