title: Adding image to PDF, Android Studio
body: <p>I'm developing app in <strong>Android Studio</strong> using <strong>iTextG</strong>, where you can fill in a form, click the button and in return You receive a PDF. At the end of the document I need to add an image.</p>
  
  <p>After pressing the button the app is crashing with note "MyApp has stopped". Yet it creates PDF file, but it is empty and I cannot open it.</p>
  
  <p>Here is my code (in function responsible for creating the document):</p>
  
  <pre><code>Paragraph test = new Paragraph();
  test.setAlignment(Element.ALIGN_LEFT);
  try {
      URL logoJock = new URL("https", "www.imgur.com", "/a/AsunJH7");
      test.add(new Jpeg(logoJock));
  } catch (Exception e) {
      e.notify();
  }
  </code></pre>
  
  <p>So I checked the usage and one way of adding image is by URL so I uploaded it on imgur.</p>
  
  <pre><code>document.open();
  document.add(data);
  document.add(test);
  document.close();
  </code></pre>
  
  <p>I'm adding the paragraph to the document. Without it, my app is creating proper document with all the data I meant to include. The only problem is adding the image. </p>
  
  <p>Can You please help me with this issue?</p>