views:

472

answers:

2

I'm dynamically creating a pdf using ABCpdf (HTML -> PDF)

I'm trying to create a Table Of Contents (with leaders), and I think the easiest way to get the leaders is using a repeat-x background-image. Here is my file structure:

/Web
   GenReport.aspx
   /images
      tocback.gif
/Data
   template.html

GenReport uses an html template, and replaces all applicable sections when generating the pdf. The styles also live in template.html.

Everything is working, except that the image isn't being found (If I use a direct path to another image on the web, I can get the image to appear in the background of the table.)

So, my question is, how do I reference the tocback.gif? Does it need to reference the path from the template (/Data/template.html - see (1) below) or from the page that generates the pdf (/Web/GenReport.aspx (2) below)?

(1) background-image: url(/images/tocback.gif);
(2) background-image: url(../Web/images/tocback.gif);

Obviously, neither of these are working for me. Am I missing something?

(I wouldn't even mind adding a hard-coded reference to an image on the FS, if that is an option.)

+2  A: 

A simple case of RTFM...

http://www.websupergoo.com/support.htm (6.17)

IniTech
A: 

Hi, you can't get that image rendered into the pdf. add a new page, render ur html into that page.pass that page url to AddImageUrl() method to generate pdf successfully.

find sample code for this in abcpdf helpline.

cheers

ch
Actually, I just used absolute paths (see my 'answer' above)
IniTech