English 中文(简体)
Add background-image to <td> in PDF (ABCpdf)
原标题:

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.)

最佳回答

I found the answer in the manual

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

问题回答

You can t get that image rendered into the pdf. Add a new page, render your html into that page.pass that page url to AddImageUrl() method to generate pdf successfully.

find sample code for this in abcpdf helpline.

cheers





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签