0

Possible Duplicate:
Android - Load PDF / PDF Viewer

I want to read pdf files in my App. So I use itextPDF but it will not work.

How can I use itextPDF.jar in Android?

Community
  • 1
  • 1
Nithinlal
  • 4,845
  • 1
  • 29
  • 40

4 Answers4

3

You can refer this for reading PDF files. It has included MuPDF, a lightweight PDF and XPS viewer. Hope this may useful to you.

nisha.113a5
  • 2,024
  • 16
  • 30
2

itextPDF.jar will work only for creating pdf file in android device.

Read this for creating pdf files in android device

Check this for PDF viewing easier from within your Android application

Community
  • 1
  • 1
Ram kiran Pachigolla
  • 20,897
  • 15
  • 57
  • 78
1

As Ram Kiran Sugguest it is not used for reading purpose . You can use APV PDF Viewer library for view pdf .

Chirag
  • 56,621
  • 29
  • 151
  • 198
1

tyr this

package android.test;

import java.io.File;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class TestActivity extends Activity {
    /** Called when the activity is first created. */
    @Override

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button button=(Button)findViewById(R.id.button1);
        button.setOnClickListener(new View.OnClickListener() {

                  @Override
                  public void onClick(View v) {
                        // TODO Auto-generated method stub
                        File file=new File("/sdcard/bill.pdf");
                        if(file.exists())
                        {
                              Uri path=Uri.fromFile(file);
                              Intent intent=new Intent(Intent.ACTION_VIEW);
                              intent.setDataAndType(path, "application/pdf");

                              try
                              {

                                    startActivity(intent);
                              }
                              catch(ActivityNotFoundException e)
                              {
                                    Toast.makeText(TestActivity.this, "No software for PDF", Toast.LENGTH_SHORT).show();
                              }
                        }
                  }
            });
    }
}
Naveen Kumar
  • 3,738
  • 4
  • 29
  • 50