title: Can't add an image to a pdf using PDFBox
body: <p>I'm writing a java app that creates a pdf from scratch using the pdfbox library.<br>
  I need to place a jpg image in one of the page.</p>
  
  <p>I'm using this code:</p>
  
  <pre><code>PDDocument document = new PDDocument();
  PDPage page = new PDPage(PDPage.PAGE_SIZE_A4);
  document.addPage(page); 
  PDPageContentStream contentStream = new PDPageContentStream(document, page);
  
  /* ... */ 
  /* code to add some text to the page */
  /* ... */
  
  InputStream in = new FileInputStream(new File("c:/myimg.jpg"));
  PDJpeg img = new PDJpeg(document, in);
  contentStream.drawImage(img, 100, 700);
  contentStream.close();
  document.save("c:/mydoc.pdf");
  </code></pre>
  
  <p>When I run the code, it terminates successfully, but if I open the generated pdf file using Acrobat Reader, the page is completely white and the image is not placed in it.<br>
  The text instead is correctly placed in the page.</p>
  
  <p>Any hint on how to put my image in the pdf?</p>