title: Image File to PDF Stream Conversion
body: <p>I am creating a routine to write a simple PDF document based on the information in <a href="http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf" rel="noreferrer">this document</a> from Adobe. Creating a stream for text and shapes has proven straightforward but I am stuck on inserting an image.</p>
  
  <p>Could anyone provide a simple explanation of how to convert a file (any image format like gif, bmp, jpg etc. would be fine) to a PDF stream? Note that I do not want to create an entire PDF file, just a stream within the file.</p>
  
  <p>With the apps I have available it is not possible to look at how it is done elsewhere because the entire stream is encoded from beginning to end and it is this encoding method that I am trying to work out.</p>
  
  <p>Whilst I do not want to re-invent the entire creating a PDF file wheel, I do want to understand how this particular part of it works so do not want to use a library (thus the reason for not mentioning the language I am using).</p>