Android: Is There Any Free PDF Library for Android

Android : Is there any free PDF library for Android

It seems that no one of the pure java pdf libraries will work with android because they use libraries that aren't supported by android. I think I read that iText is interested in doing a port to android but thinks that google should support them if they did, haven't got a source on that though.

Here is a project in work for writing pdfs in android: sourceforge.net/projects/apwlibrary
Haven't tried it and it says that it only does simple pdfs

Online Pdf Reader Android Library

Use can use Android PDFView Library -below link has complete implementation of Library

AndroidPdfViewer

Android PDFView is available in Maven Central.

<dependency>
<groupId>com.joanzapata.pdfview</groupId>
<artifactId>android-pdfview</artifactId>
<version>1.0.4</version>
<type>apklib</type>
</dependency>

Or via gradle:

compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'

Include PDFView in your layout

<com.joanzapata.pdfview.PDFView
android:id="@+id/pdfview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

Load a PDF file

pdfView.fromAsset(pdfName)
.pages(0, 2, 1, 3, 3, 3)
.defaultPage(1)
.showMinimap(false)
.enableSwipe(true)
.onDraw(onDrawListener)
.onLoad(onLoadCompleteListener)
.onPageChange(onPageChangeListener)
.load();

pages is optional, it allows you to filter and order the pages of the PDF as you need
onDraw is also optional, and allows you to draw something on a provided canvas, above the current page

Android Resumable Download

Resumable Download Resumable download allow users to pause an ongoing download, and begin the download task again whether it is paused or interrupted by unusual situations.

How to achieve resumable download? When we communicate with Hypertext Transfer Protocol(HTTP) server, we can use “Byte serving”, which allows send only a portion of an HTTP/1.1 message form a server to a client. When we already downloaded part of a file, we only need to ask the server for the rest of the file. Using Range request header example:

Android PDF Reader & Interactive Library

Try Joan's pdfviewer. You can find it here

Android is it possible to read/open a pdf file in app without any libraries?

Well, PDF Reader and PDF Viewer are the same - they are both types of programs used to read (=view) pdf files.

If your app is published on app store for free, then its not commercial app, so publishing your app on appstore is not the same as commercializing it.

BTW - Most android users have some kind of program for viewing PDF files pre-installed, so you can just open PDF viewer with intent like this:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

try {
startActivity(intent);
}
catch (ActivityNotFoundException e) {
Toast.makeText(OpenPdf.this,
"No Application Available to View PDF",
Toast.LENGTH_SHORT).show();
}

If you want to view PDF files directly in your app (which is probably what you want to do) you can use libraries like you mentioned.

EDIT: If you use GPL library, i think your application also have to be GPL (see GPL License in closed source application), but you dont have to buy license.

Android PDF Viewer Library without GPL license

http://www.pdftron.com/pdfnet/index.html this is a complete PDF toolkit (commercial)



Related Topics



Leave a reply



Submit