I am unable to get the image to render in the PDF output. I am using an explicit url, as I thought that would work, but it still doesn’t produce any output. below is my code. Everything works except the image is not in the PDF output. The image appears if I point the image src to our development environment, but I have elevated permissions on that server. Do you need more than read permissions on that directory to be able to view the images?
Hi Michael,
Hopefully?
Hi Michael,
I was able to get this working by giving the IIS user full permission on the image directory, but why does that user need full permission just to read an image from a fully qualified url?
Hi Michael,
Hi Michael,
Hi Michael,
Thanks for your patience. We would like to update you that, in shared server environment the user doesn’t need Full trust but at least High trust. As the user calls WebRequest.Create(url) method in the code therefore Medium level trust (usually used) is not enough. Please check the [MSDN link] for more information.
Medium trust:
It specifies a medium level of code access security, which means that, in addition to the restrictions for High, the ASP.NET application cannot do any of the following things by default:
Access files outside the application directory.
Access the registry.
Make network or Web service calls (using the System.Net.HttpWebRequest class, for example).
Hopefully it would help to understand the subjected scenario. Please feel free to contact us for any further assistance.
Best Regards,
Still not convinced this is the issue.
The page renders fine when requesting the page and it is on the same server, however the only way to get the image to render was to make it a fully qualified url that points to the image on a separate server.
For example:
http://production.example.com/default.html
- This page renders fine, but the image on the page that lives at http://production.example.com/img/xyz.png
does not render when converted to pdf even when using the full url to the image in the img tag.
Above page renders in pdf if I change the image path to http://beta.example.com/img/xyz.png
Hi Michael,
Hi Michael,
Hi Michael,
- Please send us your test solution (or just part of it but web.config file should exist).
- What is the value of request.Credentials = System.Net.CredentialCache.DefaultCredentials in your code snippet?
- What are the trust permissions policies set on production/beta servers?