title: Issue with Adding Image while Creating Dynamic Pdf in android
body: <p>I created pdf dynamically using below code and also using iText library:</p>
  
  <pre><code>try {
  
                  String str_path = Environment.getExternalStorageDirectory()
                          .toString();
  
                  File file;
                  file = new File(str_path, getString(R.string.app_name)
                          + ".pdf");
                  FileOutputStream fos = new FileOutputStream(file);
  
                  Document document = new Document();
                  PdfWriter.getInstance(document, fos);
  
                  document.open();
                  document.add(new Paragraph("Hello World"));
                  document.add(new Paragraph(new Date().toString()));
  
                  document.close();
                  fos.close();
  
              } catch (Exception e) {
  
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>Than i retrieve the pdf file of 976 byte. 
  When i added code for adding image to this pdf file using below code:</p>
  
  <pre><code>    try {
  
                  String str_path = Environment.getExternalStorageDirectory()
                          .toString();
  
                  File file;
                  file = new File(str_path, getString(R.string.app_name)
                          + ".pdf");
                  FileOutputStream fos = new FileOutputStream(file);
  
                  Document document = new Document();
                  PdfWriter.getInstance(document, fos);
  
                  document.open();
                  document.add(new Paragraph("Hello World, iText"));
                  document.add(new Paragraph(new Date().toString()));
  
  
                  Image image = Image.getInstance("ic_launcher.png");
                  document.add(image);
  
                  document.close();
                  fos.close();
  
              } catch (Exception e) {
  
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>Than i retrieve the pdf file of 0 byte. </p>
  
  <p>i dont know what is issue, If you have any idea related to it, than please share with me. thanks.</p>