Free Support Forum - aspose.com

URGENT: Image not showing in PDF wheni the URL t is not localhost

In our ASP.NET web application, we use ASPOSE.PDF to generate PDF documents.

WE use inline HTML approach where in we use the HTML inside DIV tag (server control) and render as PDF using ASPOSE.PDF server dll. The problem is the PDF document is not showing the image where as the HTML from the ASPX page is showing the image.

THe image path is as HTTP://servername/blabla/xyz.png which works in local development server when it is http://localhost but doesnt in QA when the URL is http://QAserver

The surprise is the image shows in HTML page DEV and QA but not in the PDF.

I am from AMEX and we have enterprise license for ASPOSE.TOTAL and extended technical support and I need this problem resolved asap . Can you please resolve and let me know if we can show the code with your person over a live meeting. I can be contacted 510-759 8336

Hi Bharanidharan,


Thanks for using our products.

I have tested the scenario using Aspose.Pdf for .NET 7.6.0 and the code snippet which you have shared, where I have update the image link as

<img src=http://www.google.com/intl/en_ALL/images/logos/images_logo_lg.gif><o:p></o:p>


and as per my observations, the image is properly appearing in resultant PDF file. Please take a look over the attached resultant PDF file which I have generated.


You may consider using pdf.HtmlInfo.ImgUrl = "D:/pdftest/MemoryStream/"; which can be used to Specify the URL which serves as images database.


In case the problem still persists or you have any further query, please feel free to contact. We are sorry for your inconvenience.

Hi Nayyer. It is still not working for us outside the dev environment.

In dev, there is no issues in various servers. Please suggest ways to make this work - this is very urgent blocker issue for us.

Aspose.Pdf.License lcn = new Aspose.Pdf.License();

lcn.SetLicense("Aspose.Total.lic");

var pdf = new Pdf();

//pdf.HtmlInfo.ImgUrl = "http://localhost/external/websites/CoBrand/P2P.Bluebird/App_Themes/Default/Images/CoBrandImages/bluebird/";

pdf.PageSetup.PageWidth = pdfGenerateDetails.PageWidth;

pdf.PageSetup.Margin.Right = pdfGenerateDetails.MarginRight;

pdf.HtmlInfo.PageWidth = pdfGenerateDetails.HtmlWidth;

pdf.HtmlInfo.TdTextMargin.Left = pdfGenerateDetails.TdTextMarginLeft;

pdf.IsFontNotFoundExceptionThrown = pdfGenerateDetails.IsFontNotFoundExceptionThrown;

pdf.BindHTML(pdfGenerateDetails.HtmlToRender);

var memoryStream = new MemoryStream();

pdf.Save(memoryStream);

return memoryStream;

v

Any permissions related issue? For any IIS/App pool account?

I request to the technical support (enhnaced) to be on call with us to help resolve. Which number should i call? I have no other way to contact other than forums. With a full fledged enterprise license on ASPOSE.Total suite - i think we should have priveleges to stay on call for any issues like this. please help

FYI-HTMLINFO.IMGURL was used but still no effect.

bharanidhar007:

Any permissions related issue? For any IIS/App pool account?

I request to the technical support (enhnaced) to be on call with us to help resolve. Which number should i call? I have no other way to contact other than forums. With a full fledged enterprise license on ASPOSE.Total suite - i think we should have priveleges to stay on call for any issues like this. please help

Hi Bharanidharan,

As per my understanding, the issue might be related to permission while accessing the directory / URL where images are stored. Can you please try accessing the individual images on QA machine and see that you are able to see the images.

Please note that we only provide technical support via forum and live chat and I am afraid technical support is not provided over phone call. We are sorry for this inconvenience.

we used to QA image web URL in dev code and it works. The image is accessible from web browser too.Is there any special permission that is required if html is having image with full url ?? Can we use an alternate approach for the image path - that will work in any environment?

We solved this with static path instead of web URL for the image link.

Thanks

Hi Bharanidharan,


Honestly speaking, I am not certain about the reasons why the images are not appearing in QA environment. There might be some restrictions while accessing images in QA. May be there is some policy restriction which is preventing images to be retrieved in QA, but as you have specified above, you are able to access/see the images in web browser in QA environment, so I could not figure out why the application is not able to retrieve the images.

Anyways, I am glad to hear that your problem is resolved when using obsolete path. In case of any further query, please feel free to contact.