Look at this site, looks like this can work.
EDIT:
Here is the code and text from the Referenced Site
The people which have been working with iTextSharp and its HTMLWorker class for rendering one HTML page to PDF knows what I'm talking about: if the HTML contains images with relative path you'll probably get the "friendly" yellow screen!
It means that iTextShap tried to get one image with the relative path "images/screenshot.3.jpg" as the local file "C:\images\screenshot.3.jpg", so, that image doesn't exist.
After doing a lot of research about how to provide to iTextSharp the correct image I found that one guy mentioned the "IImageProvider" interface that gives to iTextSharp the ability of find the image using custom methods. Well, I have done one example using iTextSharp 5.0.2.0. you can download it here.
First at all you have to create one class that implements the IImageProvider Interface:
public class CustomItextImageProvider : IImageProvider
{
#region IImageProvider Members
public iTextSharp.text.Image GetImage(string src, Dictionary<string,string> imageProperties, ChainedProperties cprops, IDocListener doc)
{
string imageLocation = imageProperties["src"].ToString();
string siteUrl = HttpContext.Current.Request.Url.AbsoluteUri.Replace(HttpContext.Current.Request.Url.AbsolutePath, "");
if (siteUrl.EndsWith("/"))
siteUrl = siteUrl.Substring(0, siteUrl.LastIndexOf("/"));
iTextSharp.text.Image image = null;
if (!imageLocation.StartsWith("http:") && !imageLocation.StartsWith("file:") && !imageLocation.StartsWith("https:") && !imageLocation.StartsWith("ftp:"))
imageLocation = siteUrl + (imageLocation.StartsWith("/") ? "" : "/") + imageLocation;
return iTextSharp.text.Image.GetInstance(imageLocation);
}
#endregion
}
After it, you have to assign this image provider as the "img_provider" interface property of the HTMLWorker class before rendering the HTML Content:
HTMLWorker worker = new HTMLWorker(document);
Dictionary<string, object> interfaceProps = new Dictionary<string, object>() {
{"img_provider", new CustomItextImageProvider()}
};
worker.InterfaceProps = interfaceProps;
Now, when you render your HTML it should work with relative images.
Althought this is one example made for ASP.Net, the main idea is how to create one custom Image Provider for iTextSharp when rendering HTML and it could be used on any application, also, this could help you not only for getting images from a relative location, I have used it (with more code, obviously) for getting images from SharePoint or Sites that require authentication.