Adobe ColdFusion 8

Creating PDF and FlashPaper output with the cfdocument tag

The cfdocument tag converts everything between its start and end tags into PDF or FlashPaper output format and returns it to the browser or saves it to a file. This lets you easily convert HTML to printable output, as the following example shows:

<cfdocument format="FlashPaper">
<p>This is a document rendered by the cfdocument tag.</p>
</cfdocument>

The cfdocument tag supports all HTML and CFML tags, with the following exceptions:

  • cfchart
  • Flash content
  • Interactive tags, such as form, cfform, and cfapplet
  • JavaScript that dynamically modifies elements or element positions

Additionally, the HTML wrapped by the cfdocument tag must be well-formed, with end tags for every start tag and proper nesting of block-level elements.

Note: ColdFusion does not return HTML and CFML outside of the <cfdocument> </cfdocument> pair.