0

I'm using Pechkin HTML to PDF generator. It works fine on local server, but throws an exception on shared hosting company.

https://github.com/tuespetre/Pechkin

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 failed.

[SecurityException: Request failed.]
   Pechkin.Factory.Create(GlobalConfig config) +0
   client_GenerateReport2.Button5_Click(Object sender, EventArgs e) +270
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9752490
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +196
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6704
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +245
   System.Web.UI.Page.ProcessRequest() +72

Can someone explain what I am doing wrong?

Muhammad zubair
  • 291
  • 2
  • 6
  • 20
  • the `security` tag is for different uses than what you have here. It is for more general applications of how to secure a program or piece of code, not for errors you are getting that just happen to have the word security in them. – TylerH May 11 '14 at 17:55

1 Answers1

0

This is a problem of security. Pechkin does not work in medium trust, which is by default on most of shared hostings

https://github.com/gmanny/Pechkin/issues/55

Simply try to set medium trust on the local machine and you will get the same error.

<system.web>
    <trust level="Medium" />
</system.web>

After research i find a library www.sautinsoft.com which work on medium trust level to generate html to pdf.

Muhammad zubair
  • 291
  • 2
  • 6
  • 20