I got something working with the following code, the information shows up in
the PDF.  Media style will mean nothing to PDF, it can only print what it
shows.  Notice that the cfdocument must surround both the <head> and <body>
tags.  It won't work if you just surround the body or the information within
the body.  (In other words, you must use proper markup (style belongs in the
<head>) and send all of that to the pdf.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
        
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
<cfdocument  format="PDF" pagetype="letter" orientation="portrait" unit="in"
encryption="none" 
fontembed="Yes" backgroundvisible="Yes">

<head>
        <title></title>
        <style type="text/css">
        
        body{
                background-image: url(hdr_right.jpg);
                background-position: top right;
                background-repeat: no-repeat;
                height: 11in;
                width: 8.5in;
                padding: .5in;

        }
        </style>
</head>
<body>
<h1> This is a test</h1>
</body></cfdocument>
</html>

Sandra Clark
==============================
http://www.shayna.com
Training in Cascading Style Sheets and Accessibility 

CSS HANDS ON
New York City, October 10-13, 2006.
http://www.shayna.com/index.cfm?fuseaction=training.syllabus_display&id=1


-----Original Message-----
From: Everett, Al (NIH/NIGMS) [C] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 13, 2006 5:29 PM
To: CF-Talk
Subject: RE: Creating a watermark for CFDOCUMENT

No, no change.

Here's the code I have:

<cfdocument backgroundvisible="yes" format="pdf" pagetype="letter"
orientation="landscape">
                <cfif arguments.report_status is "draft">
                        <style type="text/css" media="print">
                        body {
        
background-image:url(#request.baseURL#images/draft-watermark.gif);
                                background-position:center;
                        }
                        </style>                
                </cfif>

I've tried with 'media="print"' and without. I've tried the style tags
before and after <cfdocument>. I am sure that the image file exists where I
say it does. I've tried attaching the image to html and table as well as
body. All give the same result.

I tried changing my browser settings to display background images when
printing. Still nothing.

If I comment out all of the <cfdocument> and child tags, the HTML I get has
a background image.

I'm stumped. 


-----Original Message-----
From: Qasim Rasheed [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 13, 2006 5:14 PM
To: CF-Talk
Subject: Re: Creating a watermark for CFDOCUMENT

I think technically those are related. CFDocument uses the styles that you
have defined for printing and take advantage of your printing preferences.
FWIW.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:246475
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to