title: dynamic pdf-cfdocument + cfcontent + image + email attachement
body: <p>How can images be loaded into a dynamically generated pdf (cfdocument)? In that the pdf is not stored the hdd. The pdf needs to be emailed, and the ram cleared. The images are stored outside of the wwwroot folder.
  If it is need be, the pdf can get stored in the hdd, get attached, emailed, then deleted, but would opt for it not to get stored in the hdd.</p>
  
  <p>c:\coldFusion9\imgs\ is the dir </p>
  
  <p>Sample:</p>
  
  <pre><code>&lt;cfdocument format="PDF" localurl="true"&gt;
  &lt;cfoutput&gt; #vars#&lt;/cfoutput&gt;
  &lt;/cfdocument&gt;
  </code></pre>
  
  <p>I have used </p>
  
  <pre><code>&lt;img src=""&gt;
  </code></pre>
  
  <p>inside cfdocument, and it works if the image is in the wwwroot (http...) folder, but not when the image is outsite the wwwroot ("c:\coldFusion9\imgs#image#.png" or "../imgs/#image#.png").</p>
  
  <p>I suppose that cfcontent is ideal</p>
  
  <p>So, inside cfdocument, I do this:</p>
  
  <pre><code>&lt;cffile action="readbinary" file="c:\coldFusion9\imgs\#image#.png" variable="img"&gt;
  &lt;cfcontent type="image/jpg" variable="#img#" &gt; 
  </code></pre>
  
  <p>The result is that the image loads, on the screen, not the pdf.</p>
  
  <p>Would like to email the pdf as an email attachement. The pdf does not need to render on screen, but for testing purposes, we could let it render on the screen to know if the image was loaded or not, by either naming or not naming the cfdocument. The pdf renders when the name is removed, it does not render when the name is present.</p>
  
  <p>Appreciate your help.</p>