> I am trying to format a document for printing.  I am
> especially concerned with controlling the margins. I
> thought the easiest way to get control of printing in
> general would be to open it in MS Word using CFCONTENT:
>
> <CFCONTENT TYPE="application/msword">
> <CFHEADER NAME="content-disposition" VALUE="filename=File.DOC">
>
> The trouble is that this opens the document with the default
> MS Word margins. I tried using the Cascading Style Sheets MARGIN
> property in the BODY style="", but this also doesn't seem to have
> any effect on printing.
>
> I was originally trying to print directly from Internet
> Explorer 5.0 web browser, but in addition to not being able
> to programmatically control the margin, I also can't find a
> way to turn off the HEADER and FOOTER information that prints
> by default such as the URL and page numbers. (If you don't know
> what I am referring to, open Internet Explorer and then choose
> FILE>PAGE SETUP.)
>
> So the question is, can anyone think of a way for me to create
> a document from Cold Fusion, that will allow me to somehow control
> the printing margins programmatically?

You could generate RTF output, which would give you nearly complete control
over the output for printing purposes. RTF is an ASCII text-based format,
which consists of control words (similar to tags) and literal text. The
downside to this is that it's extremely annoying to work with. Your best
bet, if you want to do this, is to generate an RTF template in your favorite
word processor, then use that for the basis of your CF script. There's a
description of this (among other things) here:

http://www.figleaf.com/figleafhome/cfug/cfugjune00.zip

In addition, you'll want to get the RTF specification; just search for "RTF"
in your favorite search engine.

Alternatively, if you have Word installed on your server, you could use OLE
automation to build an actual Word document. I suspect that this would be
pretty inefficient under heavy use, though.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to