Convert JPG to PDF

Convert jpg to pdf excludes inline exception Document.open()

com.itextpdf.text.Document document = new com.itextpdf.text.Document();
PdfWriter.getInstance( document, new FileOutputStream(outputFile));
document.open();
Image image = Image.getInstance(updPath);
document.add(image);
document.close();

I added itext as an external jar file

+4
source share
1 answer

I found the answer to the above problem. I just added the jar to the libs folder, it works for me. See Link Android 17 update seems incompatible with external banks

There may be a problem with external banks,

in your project just

  • create a folder called libs.
  • Copy and paste all the necessary external jar files into this folder.
+1
source

Source: https://habr.com/ru/post/1598498/


All Articles