0

I have used itext(itextg-5.5.1.jar) Android library for converting image into PDF,for this purpose I have used below code snippet for convert the image into PDF. I can get the PDF but what problem I am facing is,It is not actually converting the whole image only converting the few part of image(Zoomed in) into PDF.how can I solve the issue any one please provide a better solution for achieving this technique.

tried code

Document document=new Document();
                String pdfPath = Environment.getExternalStorageDirectory()+"/Download"+"/exampleoutput.pdf";
                PdfWriter.getInstance(document,new FileOutputStream(pdfPath));
                document.open();
                String imagePath = Environment.getExternalStorageDirectory()+"/Download"+"/example.jpg";
                Image image = Image.getInstance (imagePath);
                document.add(image);               
                document.close();
Jamal
  • 976
  • 2
  • 14
  • 39
  • 1
    One problem I see: you don't seem to care about the size of the image. You create pages with size A4 and you add the images. If the images are smaller than size A4, you'll have plenty of white space. If the images are bigger than size A4, they will be added only partly (which is probably the problem you're describing although your question isn't clear). – Bruno Lowagie Aug 06 '14 at 15:37
  • Thanks for your reply. So you mean I need to resize the image to ( 595 * 842 )? Currently my input image size is 1456 * 2592. I think that is the problem? – Jamal Aug 07 '14 at 05:41

0 Answers0