summaryrefslogtreecommitdiff
path: root/android/jni/mupdf.c
AgeCommit message (Collapse)Author
2013-06-20Rearrange source files.Tor Andersson
2013-06-19Android build fixes.Robin Watts
2013-06-18Merge common and internal headers into one.Tor Andersson
2013-06-13Make display lists reference counted objects.Robin Watts
Remove fz_free_display_list from the API; instead use fz_drop_display_list.
2013-06-12Support begin/end page calls in text extraction device.Tor Andersson
2013-06-09Remove fz_interactive API in favour of direct use of pdf APIPaul Gardiner
2013-05-27Fix a crash when saving a file in the android app.Robin Watts
When saving, we'd close the document before we save it. As part of the leak fixing work, I'd freed the path as part of the closing process. Rework slightly to avoid this.
2013-05-27Treat multiple whitespace in search strings as single.Robin Watts
Skip over successive whitespace in search string. Make android use text_search.c
2013-05-27Fix indentation to be consistent with regard to tabs/spaces.Tor Andersson
2013-05-21Android: Fix crash when selecting text.Robin Watts
We were failing to setup and maintain the span number correctly.
2013-05-21Fix app breakages.Robin Watts
Android app was still thinking that we had only one fz_device_rgb rather than one per context. Android app had a typo in resulting in searching ending in an infinite loop. Text search failed to search outside the first block of each page.
2013-05-07Android: Fix android build.Robin Watts
Update android build in line with text extraction structure changes.
2013-05-06Add simple visual-to-logic RTL reordering as a text extraction pass.Tor Andersson
2013-04-30Android: Update text handling in android specific code.Robin Watts
Need to update text handling in line with new object types due to image extraction.
2013-04-29Add Memento build option to Android build. Fix memory leaks.Robin Watts
Following up on a report from a potential customer, fix various places in mupdf.c where we were leaking memory (devices not freed, context not properly freed etc). In order to track this down, I added a Memento build - just do: ndk-build MEMENTO=1 when building. This only checks for leaks, not for memory overwrites by default as it uses MEMENTO_LEAKONLY to avoid any possibility of the android kernel killing stuff for being too slow or using too much memory.
2013-04-29Android: Missed renaming of function.Robin Watts
We renamed fz_new_output_buffer to be fz_new_output_with_buffer, and missed the call from the Android specific source. Fixed here. Thanks to Philippe Le Becq for the report.
2013-03-29Android: some user-feedback improvementsPaul Gardiner
Disable some features when in reflow mode Disable features when document format prohibits Add a few instructional on-scrren, info messages
2013-03-26Reflow: Move from html output using tables to html output using div/spanRobin Watts
The div/spans still use table style rendering, but it's simpler code (and html) this way.
2013-03-26Rework text extraction structures.Robin Watts
Rework the text extraction structures - the broad strokes are similar but we now hold more information at each stage to enable us to perform more detailed analysis on the structure of the page. We now hold: fz_text_char's (the position, ucs value, and style of each char). fz_text_span's (sets of chars that share the same baseline/transform, with no more than an expected amount of whitespace between each char). fz_text_line's (sets of spans that share the same baseline (more or less, allowing for super/subscript, but possibly with a larger than expected amount of whitespace). fz_text_block's (sets of lines that follow one another) After fz_text_analysis is called, we hope to have fz_text_blocks split such that each block is a paragraph. This new implementation has the same restrictions as the current implementation it replaces, namely that chars are only considered for addition onto the most recent span at the moment, but this revised form is designed to allow more easy extension, and for this restriction to be lifted. Also add simple paragraph splitting based on finding the most common 'line distance' in blocks. When we add spans together to collate them into lines, we record the 'horizontal' and 'vertical' spacing between them. (Not actually horizontal or vertical, so much as 'in the direction of writing' and 'perpendicular to the direction of writing'). The 'horizontal' value enables us to more correctly output spaces when converting to (say) html later. The 'vertical' value enables us to spot subscripts and superscripts etc, as well as small changes in the baseline due to style changes. We are careful to base the baseline comparison on the baseline for the line, not the baseline for the previous span, as otherwise superscripts/ subscripts on the end of the line affect what we match next. Also, we are less tolerant of vertical shifts after a large gap. This avoids false positives where different columns just happen to almost line up.
2013-03-25Android: add support for Ink annotation creationPaul Gardiner
2013-03-21Bug 693719: Android: Catch exceptions when counting pages.Robin Watts
Return 0. Check for this case when opening a PDF and give a nice dialogue. Fix the nice dialogue code so that it doesn't crash afterwards due to a null mSearchTask.
2013-03-18Auto-generate appearance streams for strikeout, underline, highlightPaul Gardiner
This fixes bug #693664, and also simplifies app code. The example file attached to the bug produces strange results, but that is because the QuadPoint information is incorrect.
2013-02-28Pass bbox to pdf_set_annot_appearance rather than base on display listPaul Gardiner
Use of the bbox device to derive the area of the display list can lead to bad results because of heuristics used to handle corners of stroked paths.
2013-02-26Android: add support for highlight and underline markup annotations.Paul Gardiner
Highlight annotations currently come out opaque so aren't a lot of use.
2013-02-26Include required quadPoints entry in created markup annotations.Paul Gardiner
Also change the way we pass the text rectangles so that non-axis-aligned ones can be permitted, and relocate the code that calculates the strike-out lines from the bounding boxes
2013-02-26Android: implement annotation deletionPaul Gardiner
2013-02-22Android: add MuPDFCore.getAnnotationsPaul Gardiner
2013-02-06Fix Android build after reference/irect changes.Robin Watts
2013-02-06Rename bbox to irect.Tor Andersson
2013-02-05Android: use identity matrix in html extraction to improve font sizesPaul Gardiner
2013-02-05Android: Use HTML output in reflow mode.Robin Watts
This gets us styles.
2013-01-31Android: fix buildPaul Gardiner
2013-01-31Android: use a single fz_page to render both main and hq bitmapsPaul Gardiner
2013-01-31Android: implement strikeout annotation creationPaul Gardiner
2013-01-30Fix Android build after rect/bbox changes.Robin Watts
2013-01-30Eliminate fz_bbox in favor of fz_rect everywhere.Tor Andersson
2013-01-26Android: Fix NullPointerException seen on Google PlayRobin Watts
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.
2013-01-21Rename app.Robin Watts
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.
2013-01-10Android: add core method returning the words on a pagePaul Gardiner
2012-12-13Android: add hooks to the app to handle GoToR linksPaul Gardiner
2012-12-05Android: rework link handlingPaul Gardiner
Remove unnecessary hitPageLink method from MuPDFCore and extend the handling of external links to the java classes
2012-11-29Fix a couple of leaksPaul Gardiner
2012-11-28Avoid calling interactive functions with a NULL idoc.Robin Watts
This solves the android build SEGVing on xps files such as ECMA-288.xps.
2012-11-28Android: add support for listbox and combobox form fieldsPaul Gardiner
2012-11-28Android: Allow multiple instances of MuPDF to run simultaneously.Robin Watts
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).
2012-11-27Android: fix accidently swapped title and message in alert dialogPaul Gardiner
2012-11-27Android: implement saving of form dataPaul Gardiner
2012-11-19Enable android profiler build.Robin Watts
Requires android-ndk-profiler to be copied into android and android/jni. Also requires r8c of the NDK.
2012-11-19Android: implement alert dialogPaul Gardiner
2012-11-09Android: restrict annotation updates to ones within the patch areaPaul Gardiner