tags:

views:

66

answers:

3

Hi there,

Does anyone else get this problem or know a solution / workaround I could try as I'm running out of ideas? :-(

I'm running this code on ColdFusion 9 - the idea is that it creates a PDF page (a front cover to a report) applies a watermark (a design I've been given with an orange background that I put my content on) and saves it for use later down the page.

The problem I've got is firstly I needed to turn backgroundvisible on in the cfdocument tag. Reason for this is I kept getting this white square showing on top of my produced page. When I do this though cfdocument then ignore any font colour changes I make it.

I've tried all kinds of combinations of trying to get this including styles, classes. internal / external CSS files but everytime ColdFusion defaults it to black.

Does anyone have any suggestions on what I can do to get this showing in white?

<cfdocument format="pdf" marginbottom="0" marginleft="0.77" marginright="0" margintop="5" pageType="A4" unit="in" name="cover" backgroundvisible="false">
<cfoutput>
 <html>
   <head>
   </head>
   <body style="color:##fff">
       here
    </body>
  </html>
</cfoutput>
 </cfdocument>


<cfpdf action="addWatermark" copyFrom="#coverFile#" source="cover" foreground="false" opacity="10" showonprint="true" />
<cfpdf action="write" destination='#PDFDir##frontCoverFile#' source="cover" overwrite="true" />

Thanks very much, James

P.S. It maybe that a workaround has to be using CFIMAGE to produce this and then placing that in the page instead. I'd rather not though :-(

A: 

Don't know anything about CF mate, but you have two hashtags before the hex colour, so it probably won't be read!

Ewan
In CF, #var# displays the contents of the var variable. ## is used to escape the hash tag.
Ben Doom
ColdFusion uses ## as a way of declaring variables. i.e. #foo#. If you need to use # in the styling, while in a cfoutput, you need to do a double hash to escape. Like I say though I've put this in an external file as well and it doesn't like it :-(
James Buckingham
A: 

Try using straight HTML styles . Tried it and it seemed to do the job.

Ello world

Pete
Thanks Pete. Did you try it with the watermark though? I've got other pages further down (the body of the report) that are working fine. It's seems to be from this combining with a watermark and displaying that I'm struggling with
James Buckingham
A: 

Unfortunately in the case of this question I had to strip the PDF right back to basics.

I had more problems than just this but generally when it comes to PDF features in ColdFusion Adobe will certainly have to pull their fingers out as it's really buggy :-(

James Buckingham