Error while generating pdf with android

view story

http://stackoverflow.com – I'm trying to do a pdf creator. I tried a lot and found some coding but i'm still getting an error and i don't know how to solve it. Here is my code: public void GenerarPDF(View view){ try{ Document document=new Document(); File root = new File(Environment.getExternalStorageDirectory(), "Notes"); if (!root.exists()) { root.mkdirs(); } File gpxfile = new File(root, "generando.pdf"); PdfWriter.getInstance(document,new FileOutputStream(gpxfile)); document.open(); document.add(new Paragraph("Testing testing and testing")); document.close(); }catch(Exception e){ e.pr (HowTos)