Skip to content Skip to sidebar Skip to footer

How To Solve Read Only File System Error In Android Programming With Eclipse

I am developing a program in which i must create pdf file inside application. This is the code that i use for creating pdf file but an error occurred that say '/Image.pdf:open fail

Solution 1:

Try to write pdf in sdcard root directory:

PdfWriter.getInstance(document,newFileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath()+"Image.pdf"));

Solution 2:

first i thank Haresh Chhelana for his answers.

by using this code i can create new pdf file with an image in it.

Documentdocument = newDocument();
            PdfWriter.getInstance(document,newFileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath()+"/Image.pdf"));
            document.open();
            Image image1 = Image.getInstance(Environment.getExternalStorageDirectory()+"/01.jpg");
            document.add(image1);
            document.close();

Post a Comment for "How To Solve Read Only File System Error In Android Programming With Eclipse"