When you are generating the html, preserve whatever data you need as session
variables.
Put the code that converts the content to pdf (you can use cfdocument for
this) in a separate template. Let's call it abc.cfm. It's going to be called
as a pop-up, so, at the end of that template, add something like this:
<script>
winClose=window.setTimeout("window.close()",2000);
</script>
To call it with a button, do something like this:
<a href="javascript:void(0)" onclick="Emailwin=window.open('abc.cfm','thewin',
'width=500,height=500,left=30,top=30');">
<input type="button" value="whatever" />
</a>