Converting Image into PDF

355 Views Asked by At

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();
0

There are 0 best solutions below