Not able to run simple program of iText library in android

后端 未结 2 393
时光取名叫无心
时光取名叫无心 2021-01-25 11:25

I want to run a simple iText program, here is my code: http://pastebin.com/C6YMkYNk

It is working fine with Java but not in Android. I am using iText version 5.1.3. My c

相关标签:
2条回答
  • 2021-01-25 11:49

    Try this:

    FileOutputStream fOut = openFileOutput("a.pdf", MODE_WORLD_READABLE);
    PdfWriter.getInstance(document, fOut);
    

    You cant just start writing to the working directory. You have to store it on the sdcard

    0 讨论(0)
  • 2021-01-25 11:49

    I don't think that version of the library is optimized for Android dev as it contains several libraries that do not work for Android....such as the AWT libraries.

    You need to contact their sales department to find out how to get your hands on the Android library of iText

    0 讨论(0)
提交回复
热议问题