Image path problem in xml


#1

I have the following xml together with my cs code under http://localhost/pdf/














My logo.jpg is at http://localhost/images/

I noticed that the "Image File" path has to have the ".." to find the relative image location so if I move the xml and cs code to some folder like http://localhost/pdf/pdf/, I'll have to change the path to "../../" again. I tried <Image File="/images/logo.jpg", but it couldn't locate the absolute path. Is there a way to get around this problem? Many Thanks.

Jerry



#2

Dear Jerry,

In my test it works. Here is my code:

[xml]


   string path = MapPath(".");
   Pdf pdf = new Pdf();
   pdf.BindXML(path + "/TestImagePath.xml",null);
   pdf.Save("output.pdf",Aspose.Pdf.SaveType.OpenInBrowser,Response);
   Response.End();

Please also make sure you are using the latest version.