I'm developing an android app in which i'll be generating an pdf file which i want to sent as an email. Following is the code for generating pdf file:
public void createPDF(View view) {
Document doc = new Document();
String outPath = Environment.getExternalStorageDirectory()+"/mypdf.pdf";
try {
PdfWriter.getInstance(doc,new FileOutputStream(outPath));
doc.open();
doc.add(new Paragraph(edttxt1.getText().toString()));
doc.add(new Paragraph(txt.getText().toString()));
doc.close();
} catch (DocumentException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
Help me to email this file by clicking a button.