Git Product home page Git Product logo

android-mupdf's Introduction

Android-MuPDF

MuPDF usage for magazine reading.

MuPDF developer team: http://mupdf.com/

Original source repository: http://git.ghostscript.com/?p=mupdf.git;a=summary

Native libs compiled from original source commit: http://git.ghostscript.com/?p=mupdf.git;a=tree;h=a0a9ce485579352ce9c3c4568c07e56b7029a8c8;hb=a0a9ce485579352ce9c3c4568c07e56b7029a8c8

With small change:

diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c
index 5e04ff8..5d8b7d3 100644
--- a/platform/android/viewer/jni/mupdf.c
+++ b/platform/android/viewer/jni/mupdf.c
@@ -15,8 +15,8 @@
 #include "mupdf/fitz.h"
 #include "mupdf/pdf.h"
 
-#define JNI_FN(A) Java_com_artifex_mupdfdemo_ ## A
-#define PACKAGENAME "com/artifex/mupdfdemo"
+#define JNI_FN(A) Java_com_artifex_mupdflib_ ## A
+#define PACKAGENAME "com/artifex/mupdflib"
 
 #define LOG_TAG "libmupdf"
 #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)

android-mupdf's People

Contributors

joniks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-mupdf's Issues

License issue: MuPDF is GNU AGPL licensed

MuPDF is released under the GNU AGPL. As such your code also needs to be licensed under the GNU APGL. You need to supply a copy of the license terms, and a pointer to where people can get the source from.

Please either do this, or take this repo down.

Thanks.

Show cover page in center, while displaying 2 pages on screen

We are showing PDF with core.setDisplayPages(2); i.e 2 pages per screen. But cover page is rendered on the right side of the screen as this image shows.
orignal1

We need to set the first/cover page in center of the screen as per the image below,
required

We tried to re-position the page but logic doesn't work with zooming effect on double tap;instead the PDF page and the gray patch collapse with each other. Is it possible to show cover page with proper positioning and zooming?

Please suggest ASAP.

jniLibs problem

Hi @joniks
I've just use this library and success. but now i need to uplaod my application to the googlePlay ,so i need the arm64-v8a.so,but i dont know how to make it,could you help me to make this,thanks so much!

Alternatives for deprecated methods for MuPDF

In our Android application we were using previous version of MuPDF library, and it was used for showing PDF with embedded links as well as custom widgets such as image gallery, youtube video, scrolling text etc. using getPageLink() where this method was used for reading the links.

But now we have used your project as the base to integrate the MuPDF in application for upgrading the application with latest MuPDF library.But there are such methods which are deprecated and not found in current MuPDFCore.java. Since they are native methods we cannot write any custom method which would serve the same purpose.

There are many more methods which found previously but now they are deprecated one of them is the getPageLink().

So are there any alternative to use these methods or are there any such methods which might serve the same purpose.

Please let us know any solution ASAP.

Android application is crashing saying java.lang.UnsatisfiedLinkError: No implementation found for long com.artifex.mupdf.MuPDFCore.openBuffer

I have added libmupdf_java.so files under libs folder. but application is crashing and not working for me.

java.lang.UnsatisfiedLinkError: No implementation found for long com.artifex.mupdf.MuPDFCore.openBuffer(java.lang.String) (tried Java_com_artifex_mupdf_MuPDFCore_openBuffer and Java_com_artifex_mupdf_MuPDFCore_openBuffer__Ljava_lang_String_2)
at com.artifex.mupdf.MuPDFCore.openBuffer(Native Method)
at com.artifex.mupdf.MuPDFCore.(MuPDFCore.java:156)
at com.artifex.mupdf.MuPDFActivity.openBuffer(MuPDFActivity.java:317)

I would be thankful for any help or any thread to overcome this scenario.

Help Please. About library libmupdf_java.so file

Hi @joniks
I've just use this library and success. But any some device got force close because file libmupdf_java.so nothing in folder arm64-v8a and x86_64 I guest. Can you help me please create the file .so to two folders, please.

Thank you very much

How achieve orginal mupdf fuction?

I am trying to copy orginal mupdf highlight and Ink and Underline and StrikeOut.

But it cannot use.

It can draw but not show anything I drawn.

And It can't save anything.

Thank you.

64 bit support

MuPDF doesn't support 64 bit. only 32 bit .so file available. please update it with 64 bit

Large size pdf files render cause memory issue and crash app

** If I am trying to render 1.68MB pdf file I am getting blank black screen

If I am scrolling the mDocView ( listview ) memory issue came and crash the application

-- can you please suggest how can I load HD version PDF files?

Error:

E/OpenGLRenderer: GL error: Out of memory!
E/art: Throwing OutOfMemoryError "Failed to allocate a 8294412 byte allocation with 16777120 free bytes and 228MB until OOM"
E/libmupdf: error: cycle in page tree
E/libmupdf: cannot make displaylist from page 2
E/libmupdf: error: cycle in page tree
E/libmupdf: cannot make displaylist from page 2
E/libmupdf: error: cycle in page tree
E/libmupdf: cannot make displaylist from page 2
E/libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 25956 (Thread-29224)

                                                         [ 05-12 16:18:46.027 18198:18198 W/         ]
                                                         handle_request(10) debug_value = false;


                                                         [ 05-12 16:18:46.027 18198:18198 W/         ]
                                                         wait_for_sigstope = 19

                                                         [ 05-12 16:18:46.077 18198:18198 W/         ]
                                                         wait_for_sigstope = 6

E/libutils.threads: androidCreateRawThreadEtc failed (entry=0xb6dadb01, res=11, errno=0)

Unwanted blue stroke on text

We are facing an issue with a blue stroke on some text of the pdf file. Specifically, text with red color inside double quotes and links. Any help will be appreciable.

Thanks.

Initial Page Render Issue

The library works great,thanks a ton!

Facing a minor issue,
sometimes in pdfs with more than one page the initial page gets scrunched/pressed from all sides and is center aligned,
the remaining pages are properly rendered.

Any idea why this happens? is it a cover page settings?
can i turn this off?

heap corruption detected by dlfree

samsung SM-t5250 galaxy tab pro
I work with the large pdf files (100mb-200mb) that include scanned images
MuPDFActivity periodically crash with a this log:

153/bbtech.com.gdocuments E/libmupdf﹕ Rendering page(55)=986x1394 patch=[0,0,986,1394]
10-07 12:48:29.766 1917-2153/bbtech.com.gdocuments E/libmupdf﹕ error: Render aborted
10-07 12:48:29.766 1917-2153/bbtech.com.gdocuments E/libmupdf﹕ Render failed
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments D/dalvikvm﹕ GC_FOR_ALLOC freed 5425K, 37% free 71752K/113600K, paused 14ms, total 14ms
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments I/libmupdf﹕ Drop page 58
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments E/libmupdf﹕ Goto page 56...
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments I/libmupdf﹕ Load page 56
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments E/libmupdf﹕ PageWidth=1190
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments E/libmupdf﹕ PageHeight=1682
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments I/libmupdf﹕ In native method
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments I/libmupdf﹕ Checking format
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments I/libmupdf﹕ locking pixels
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments E/libmupdf﹕ Rendering page(56)=986x1394 patch=[0,0,986,1394]
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments A/libc﹕ heap corruption detected by dlfree
10-07 12:48:29.786 1917-2153/bbtech.com.gdocuments A/libc﹕ Fatal signal 6 (SIGABRT) at 0x0000077d (code=-6), thread 2153 (AsyncTask #3)
10-07 12:48:30.426 3209-3209/bbtech.com.gdocuments W/ApplicationPackageManager﹕ getCSCPackageItemText()
10-07 12:48:30.466 3209-3209/bbtech.com.gdocuments E/MoreInfoHPW_ViewGroup﹕ Parent view is not a TextView
10-07 12:48:30.506 3209-3209/bbtech.com.gdocuments D/AbsListView﹕ Get MotionRecognitionManager
10-07 12:48:30.526 3209-3209/bbtech.com.gdocuments D/AbsListView﹕ onVisibilityChanged() is called, visibility : 4
10-07 12:48:30.526 3209-3209/bbtech.com.gdocuments D/AbsListView﹕ unregisterIRListener() is called
10-07 12:48:30.536 3209-3209/bbtech.com.gdocuments D/AbsListView﹕ onVisibilityChanged() is called, visibility : 0
10-07 12:48:30.536 3209-3209/bbtech.com.gdocuments D/AbsListView﹕ unregisterIRListener() is called
10-07 12:48:30.566 3209-3209/bbtech.com.gdocuments I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: ()
OpenGL ES Shader Compiler Version: E031.24.00.06
Build Date: 01/14/14 Tue
Local Branch: AU56_preserved_CAC_shader_repixel_zeroTimeout
Remote Branch:
Local Patches:
Reconstruct Branch:
10-07 12:48:30.586 3209-3209/bbtech.com.gdocuments D/OpenGLRenderer﹕ Enabling debug mode 0
10-07 12:48:30.606 3209-3209/bbtech.com.gdocuments D/AbsListView﹕ unregisterIRListener() is called
10-07 12:48:30.606 3209-3209/bbtech.com.gdocuments D/AbsListView﹕ onVisibilityChanged() is called, visibility : 4
10-07 12:48:30.606 3209-3209/bbtech.com.gdocuments D/AbsListView﹕ unregisterIRListener() is called
10-07 12:48:30.646 3209-3209/bbtech.com.gdocuments D/AbsListView﹕ unregisterIRListener() is called

sometimes APP crash with this log

10-07 12:19:57.216 31716-31845/bbtech.com.gdocuments E/libmupdf﹕ Rendering page(6)=986x1394 patch=[0,0,986,1394]
10-07 12:19:57.216 31716-31845/bbtech.com.gdocuments A/libc﹕ heap corruption detected by dlfree
10-07 12:19:57.216 31716-31845/bbtech.com.gdocuments A/libc﹕ Fatal signal 6 (SIGABRT) at 0x00007be4 (code=-6), thread 31845 (AsyncTask #3)

ps: sorry for my bad english

How to create pdf?

I could make application that is pdfreader using MuPDFActivity
But I want to know how to create and edit pdf

Error with Enable Proguard

Hi, i want user proguard with your library but when it run has issue occure.
Help to tell me how to enable proguard with mupdf library?
Thank you for advance.

java.lang.NoSuchFieldError: no "J" field "globals" in class "Lcom/artifex/mupdflib/MuPDFCore;" or its superclasses
at com.artifex.mupdflib.MuPDFCore.openFile(Native Method)
at com.artifex.mupdflib.MuPDFCore.(Unknown Source)

Reflow mode

I'm not sure what's the meaning of "reflow mode", when I choose reflow mode, every page is blank, does webview loadData(b64, "text/html; charset=utf-8", "base64") doesn't working? or is it pdf problem? Hope to get some ideas. Thx.

It can not worked well ,and the log is blow,please help me ,thank you!

FATAL EXCEPTION: main
Process: com.sunnymum.xing, PID: 17390
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.sunnymum.client-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libmupdf.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at com.artifex.mupdfdemo.MuPDFCore.(MuPDFCore.java:16)
at com.artifex.mupdfdemo.MuPDFActivity.openFile(MuPDFActivity.java:212)
at com.artifex.mupdfdemo.MuPDFActivity.onCreate(MuPDFActivity.java:308)

Change default language

There is a function in LibraryUtils that change the language and is set to "lv" by default. It need to be changed to this

String lang = sharedPrefs.getString(PREF_APP_LANGUAGE, Locale.getDefault().getLanguage() );

How to add Text Annotation

Annotation Type

There are some type in MUPDF in

public class Annotation extends RectF {
enum Type {
TEXT, LINK, FREETEXT, LINE, SQUARE, CIRCLE, POLYGON, POLYLINE, HIGHLIGHT, UNDERLINE, SQUIGGLY, STRIKEOUT, STAMP, CARET, INK, POPUP, FILEATTACHMENT, SOUND, MOVIE, WIDGET, SCREEN, PRINTERMARK, TRAPNET, WATERMARK, A3D, UNKNOWN
}

Question

How to I use FREETEXT or WATERMARK,

Can you give me some example for the other type ?

Where can I see the Internal API doc?

MayBe like this in MuPDFCore

public void addFreetextAnnotation(int page, float x, float y, String text){
   gotoPage(page);
   addFreetextAnnotationInInternal(text)
}

Watiing for 💗

Please provide some info how you build Mupdf

I am trying days to build mupdf but can't do it and it fails every time
i go trough the guides in the mupdf.com but it gives lots of errors
If you can provide us some info about steps you go through building mupdf.so it would be nice
Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.