I know this is what PDFs are for but my clients want a nicely styled word docx

I know this is what PDFs are for but my clients want a nicely styled word docx, so I tried this:


<cfsavecontent variable="style4html4word">
<style>
h1, h2, h3 {text-align:center;font-family: Arial;}
p {font-size:11pt;font-family: Arial;margin: 0 1cm 0 1cm;}
.bottomtext {text-align:right;padding-top:15em;margin-bottom:2em;}
</style>
</cfsavecontent>

This works but is it just nuts?


<form action="https://secure.whatever.com/notauthenticated/tohtml4word.cfm" method="post" target="_blank">
<input type="hidden" name="filename" value="well_formed_name" />
<cfoutput><textarea cols="50" rows="10" name="content" style="display: none;"><html><head><title>All Whatever</title>#variables.style4html4word#</head><body>#allContent#</body></html></textarea></cfoutput>
<div><input type="submit" value=" Open as Word " onclick="progress();" /></div>
</form>
<cfoutput>
#allContent#
</cfoutput>

tohtml4word.cfm is just:


<cfheader name="Content-type" value="application/html">
<cfheader name="Cache-Control" value="max-age=0">
<cfheader name="Pragma" value="public">
<cfheader name="Content-disposition" value="attachment; filename=#form.filename#.htm">
<cfoutput>#form.content#</cfoutput>

Am I just abusing Coldfusion ease-of-use? What would be better from a maintenance point of view?

Comments
Anonymous Coward's Gravatar Was the above comment added by some bot that has found a way around Captcha?
# Posted By Anonymous Coward | 11/13/10 7:11 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.1.002. Contact Blog Owner