• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFDOCUMENT: Display images in TD background

New Here ,
Jul 06, 2006 Jul 06, 2006

Copy link to clipboard

Copied

I am trying to get cfdocument to create a PDF and have images display in a table cell's background inside of a PDF. I just want to do:

<td style="background-image:url('myimage.jpg'); height:20px; width:20px; background-repeat:no-repeat;">
Text goes here on top of image
</td>

OR

<td background="myimage.jpg" height="20" width="20">
Text goes here on top of image
</td>

but it does not display at all. Using the <img> tag the images display no problem but then I can't write text on top of the image.


I am trying to avoid using the <img> tag because I cannot write text over top of the image; I have to insert dynamic text on top of images in my application (which in essence is a ticket that users can print out at home and use just like any other ordinary ticket. <td background=""> works great when viewing on a web page but you can't print the images unless you specify this functionality in the browser's advanced settings which is what we are trying to avoid altogether. I would love to just throw a javascript alert message to the user instructing them how to enable printing of background images and colors but my supervisor forbids this because there is just too much text and most people won't even read it (I am one of them haha).

Any ideas or suggestions are greatly appreciated.

TOPICS
Advanced techniques

Views

586

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2006 Jul 06, 2006

Copy link to clipboard

Copied

LATEST
Okay, I found my answer. YES!! It is possible...the trick?

WRAP ALL COLDFUSION VARIABLES WITH <cfoutput> TAGS!

I referenced my images using http://#CGI.SERVER_NAME#/images/myimage.jpg and forgot to put <cfoutput> tags around the text. Well, good news is, the PDF still worked fine, no red X or anything...but I was actually about to throw this idea out of the window until I tried my answer. I am happy now and can finally go home and eat some grub!

PS - CANT WAIT FOR MAX06!!!! VEGAS BABY, YEAH!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation