PDF Viewer library for Android or muPDF library tutorials

I am trying to read pdf files in an android application. I don’t want to use the default PDF program and just open a new intention because I need my own graphical interface and you want to use the first page as a cover. Therefore, I need to make my own PDF reader. I did some research and came across muPDF and Android PDF Viewer Library .

  • I tried to complete the tutorial on implementing a PDF view library in PDF from the github description. But the problem is that it downloads the pdf file forever. Do I need to do anything else but the steps in the description?

  • I can not find tutorials for the muPDF library, are there any? How to implement it?

  • If there are no useful answers to the two previous questions, is there a good PDF library with tutorials and good documentation?

Thanks, I hope I can solve my problem.

+7
java android pdf mupdf
source share
5 answers

MuPDF is a very good library, you can definitely use it. If you need a complete Android application example using MuPDF, I suggest you take a look at this custom logging application on Github .

+7
source share

First of all, if you want to use MUPDF in an existing Android application project, you can follow the manual that you will find in this link (all credits go to the author, I did not write this).

I am also trying to integrate a very simple PDF reader / print solution in my application, and I am struggling to break up / simplify the demo version of the MuPdf application that you get by following this guide. I already managed (somehow) to remove annotations and file selection functions, but I really would need help to do all the work. There really is a lot of material and absolutely no documentation about it. I am just trying to read the code and find out what is needed and what isn’t by deleting the functions one by one and managing the errors you get in catlog.

In addition, since both of us (if I understood your needs correctly) only need PDF rendering functions, it would be great if someone pointed out how (if possible) to disable some unnecessary functions built into the MuPDF library when creating it from source (as support for DjVu, as an example).

Hope this helps, even if this is not a real answer to your question.

+7
source share

This is how I managed to create the MuPDF library for Windows with Cygwin, android-ndk

  • Download MuPDF 1.3 Source from https://code.google.com/p/mupdf/downloads/list unzip to c: /mupdf-1.3-source

  • Install Cygwin: Download and run Run setup-x86.exe from http://cygwin.com/install.html when installing cygwin make sure you select C ++ packages and compilers

  • Create a file. open cygwin terminal, run

    cd /cygdrive/ cd c/mupdf-1.3-source make generate 
  • Install android-ndk: download android-ndk-r9d-windows-x86.zip and unzip it to

     c:/android-ndk-r9d 
  • Build mupdf lib: on the Windows cmd console:

    • Training:

       cd c:/mupdf-1.3-source/platform/android copy local.properties.sample local.properties 

      change local.properties, uncomment

       #sdk.dir=C:\\Program Files (x86)\\Android\\android-sdk 

      and change to

       sdk.dir=REAL andforid-sdk Folder 
    • builds: while still on c:/mupdf-1.3-source/platform/android , run:

       /android-ndk-r9d/ndk-build 

      Upon completion of the assembly in the folder

      a folder called libs will be created.
       c:/mupdf-1.3-source/platform/android 
  • Create android apk. Open eclipse, create a new android project from existing code, go to c:/mupdf-1.3-source/platform/android , now you can create mupdf apk.

+6
source share

Starting with Android 5.0, you can also use the built-in and for managing PDF you can always use iTextg - only some alternatives for the future.

+3
source share

This SO answer lists some steps on how to copy the necessary fragments from the Java MuPDF sample application into one of your own.

It is advisable that I have a "ready-to-use" Java library that I can join as a dependency. Is JNI a prevention of this, or simply because no one was able to do this?

Well, jmupdf is (the duplicate mentioned in this one) but this is a list of Windows and Linux (not Android) as the tested platforms. It seems working and dead to me (no change in 12 months). At least compared to the vibration of the MuPDF itself.

0
source share

All Articles