开发者

CFDOCUMENT ignores font coloring when backgroundvisible is false

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="cov开发者_JAVA技巧er" 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 :-(


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

Ello world


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 :-(


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜