Not able to run simple program of iText library in android

后端 未结 2 420
时光取名叫无心
时光取名叫无心 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

提交回复
热议问题