ASPOSE PDF imageURL folder needs to be shared to everyone

Hello,

we are loading an image to pdf. Image folder is set using the "pdf.HtmlInfo.imgUrl" as it is in the below code. It works fine that is the image is loaded to pdf.

Aspose.Pdf.Generator.Pdf pdf = new Pdf();
pdf.HtmlInfo.ImgUrl = imageURL;

But imageURL folder which is in webserver needs to be shared to everyone.If we don't share the image, it is not getting loaded to pdf. we don't want this image folder available to everyone.

Is there a way to load image to pdf without sharing the ImgUrl folder to everyone?

Thanks for your time
Sivantos



Hi Sivantos,

Thanks for your inquriy. Please note when you are working in shared server environment then you need to set Full Trust permissions. All Aspose .NET components are recommended to run with Full Trust permission set. This is because Aspose .NET component sometimes need to access registry settings and files located in places other than the virtual directory e.g. for reading fonts/images etc. So you need to set the necessary permission for Aspose.Pdf. Hopefully it will help you to understand the scenario.

Medium trust permissions does not work due to following limitations and please also 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).

Best Regards,