cfdocument basically takes a PDF or Flash "snapshot" of the
content currently in the tag. To make documents from dynamic
output, you would have to take a series of snapshots, for example,
by means of a loop. However, Coldfusion will not return any HTML or
CFML code outside the <cfdocument></cfdocument> tag
pair. Hence, one solution is to gather your dynamic content as one
snapshot.
An example: