I tried to convert a text to PDF in Android, using iText (here ), but it gives the “File not found” exception.
Here is the code:
try
{
PdfWriter.getInstance(document, new FileOutputStream("hello.pdf"));
document.open();
document.add(new Paragraph("Hello World"));
document.close();
Log.d("OK", "done");
}
catch (FileNotFoundException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (DocumentException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Would you please help me? Thanks
This works perfect in my case,
And in manifest file,