Creating PDF using itextsharp, security exception on server while reading images
===

i am creating pdf by using itextsharp.dll, and saving that file in database. Its working fine in local(with images) it is also working fine on server but images are missing( with try catch) . it did not throw any error. When I removed try catch to find why images are missing in pdf, I am getting images from server root folder F:\Inetpub\wwwroot\images\ , it thrown below error 

                fileExtension = ".pdf";
                writer = new JDocumentWriter(quoteObj, str + fileExtension, com.hpq.util.print.JDocumentConstants_Fields.DOC_TYPE_PDF, parms);
                **writer.createDocument();** //getting error here
                writer = null;
                break;

Security Exception 
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. 

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.


I tried this,  i have added assemblyinfo.cs ..but same error is coming.Specifically, I modified the AssemblyInfo.cs file by adding these references and attribute:

using System.Security; using System.Security.Permissions; [assembly: AllowPartiallyTrustedCallers()]

but it did not work.

Did anyone face this problem, please post some solution.

Thanks in advance.