Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8909973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:34:15+00:00 2026-06-15T03:34:15+00:00

How to create PDF file with multiple pages from image file in Android? I

  • 0

How to create PDF file with multiple pages from image file in Android? I created one PDF file from image. That PDF file has one page. That is half of that image. In the right side search part is cut in PDF file.
I am using itext-5.3.4.jar for create PDF.

    wbviewnews.loadUrl("http://developer.android.com/about/index.html");
   // button for create wbpage to image than image to PDF file
            Button  btnclick =(Button)findViewById(R.id.btnclick);
            btnclick.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

                Picture p = wbviewnews.capturePicture();
                bitmap=null;


                PictureDrawable pictureDrawable = new PictureDrawable(p);

                bitmap = Bitmap.createBitmap(pictureDrawable.getIntrinsicWidth(),pictureDrawable.getIntrinsicHeight(), Config.ARGB_8888);
                //Bitmap bitmap = Bitmap.createBitmap(200,200, Config.ARGB_8888);
                Canvas canvas = new Canvas(bitmap);
                canvas.drawPicture(pictureDrawable.getPicture());

                ImageView imgdata=(ImageView)findViewById(R.id.imgdata);
                imgdata.setImageBitmap(bitmap); 

                String filename = "pippo.png";
                File sd = Environment.getExternalStorageDirectory();

                File dest = new File(sd, filename);
                String pdffilename = "pippo.pdf";
                File pdffilepath = new File(sd, pdffilename);


                try {
                    FileOutputStream out = new FileOutputStream(dest);

                    bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
                    out.flush();
                    out.close();

                } catch (Exception e) {
                    e.printStackTrace();
                    Log.e("Exception", e.toString());
                }

                Document document=new Document();


                try {
                    Log.e("pdffilepath", pdffilepath.toString());
                    PdfWriter writer = PdfWriter.getInstance(document,new FileOutputStream(pdffilepath));
                    document.open();

                    //  URL url = new URL (Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+filename);
                    //  Log.e("url", url.toString());
                    Image image = Image.getInstance(Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+filename) ;

                    document.add(image);               
                    document.close();
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                    Log.e("FileNotFoundException", e.toString());
                } catch (DocumentException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                    Log.e("DocumentException", e.toString());
                } catch (MalformedURLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                    Log.e("MalformedURLException", e.toString());
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                    Log.e("IOException", e.toString());
                }

            }
        });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:34:16+00:00Added an answer on June 15, 2026 at 3:34 am

    Your search through StackOverflow is less I guess cause I found these answer already there having solution, yes its contained in different answer and looking at the Q/A I guess they can solve your problem, if not then keep trying 🙂

    how to Generate Pdf File with Image in android?

    How to create a PDF with multiple pages from a Graphics object with Java and itext

    iText Example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a PDF file that has multiple spaces between characters. It is that
Can we create PDF file from android application, do any libraries available to do
I need to create a PDF or Word file filled with contents from my
PdfFileReader reads the content from a pdf file to create an object. I am
I'm using a plugin from jquery to use a multiple file upload to create
I want to create a PDF file from my PHP (HTML+CSS) but I positioning
I want to create a pdf file from Binary data. I looked around and
Can we create PDF file in android? I have Tried all Google Search. Also
I'm using Symfony 1.4 and I have to create pdf file from Word/HTML with
As we know that it is possible to create pdf file in iphone application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.