title: CFDocument: coldfusion.document.spi.DocumentExportException: java.lang.NullPointerException
body: <p>I am trying to create a pdf using <code>cfdocument</code> but ColdFusion keeps throwing an exception and I can't find a way to work around this.</p>
  
  <p>This is the code that I am using:</p>
  
  <pre><code>&lt;cfdocument format="pdf" filename="rep_report.pdf" overwrite="yes" name="rep_report"&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
        &lt;title&gt;Untitled Document&lt;/title&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
        &lt;style&gt;
            &lt;cfinclude template="stylesheets/bootstrap.min.css"&gt;
        &lt;/style&gt;
  
        &lt;cfinclude template="views/_reputationTable.cfm"&gt;  
    &lt;/body&gt;
  &lt;/html&gt;
  &lt;/cfdocument&gt;
  </code></pre>
  
  <p>And this is the exception:</p>
  
  <pre><code>An exception occurred when performing document processing.
  The cause of this exception was that: coldfusion.document.spi.DocumentExportException: java.lang.NullPointerException.
  
  The error occurred in E:/sites/xAmplifier.com/admin/rep_report_template.cfm: line 43
  Called from E:/sites/xAmplifier.com/admin/wheels/events/onrequest.cfm: line 1
  Called from E:/sites/xAmplifier.com/admin/rep_report_template.cfm: line 43
  Called from E:/sites/xAmplifier.com/admin/wheels/events/onrequest.cfm: line 1
  41 :       &lt;/style&gt;
  42 :       
  43 :       &lt;cfinclude template="views/_reputationTable.cfm"&gt;  
  44 :   &lt;/body&gt;
  45 : &lt;/html&gt;
  </code></pre>
  
  <p>It seems that my issue is the part where I am trying to include a template but unfortunately I don't have a way around this. </p>
  
  <p>Any suggestions on how I can keep the included template and use cfdocument?</p>