title: Convert image to pdf with iText and Java
body: <p>I succesfully converted image files (gif, png, jpg, bmp) to pdf's using iText 1.3.
  I can't change the version since we can't just change versions of a jar obviously in a professional environment.</p>
  
  <p>The problem that I have is that the size of the image in the pdf is larger than the image itself. I am not talking about the file size but about the size of the image when the zoom is set to 100% on both the original image file and the pdf.
  The pdf shows the image about a 20% to 30% bigger than the original image.</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>    public void convertOtherImages2pdf(byte[] in, OutputStream out, String title, String author) throws IOException {
          Image image = Image.getInstance(in);
          Rectangle imageSize = new Rectangle(image.width() + 1f, image.height() + 1f);
          image.scaleAbsolute(image.width(), image.height());
          com.lowagie.text.Document document = new com.lowagie.text.Document(imageSize, 0, 0, 0, 0);
          PdfWriter writer = PdfWriter.getInstance(document, out);
          document.open();
          document.add(image);
          document.close();
          writer.close();
      }
  </code></pre>