Welcome Guest Search | Active Topics | Sign In | Register

PDF - Access is Denied error Options
Leighton
Posted: Friday, March 1, 2013 5:56:07 AM
Rank: Newbie
Groups: Member

Joined: 8/24/2011
Posts: 3
Hi there,

I am having an issue with generating a pdf on the live server. Locally it works fine. I have set the Trust Level in web.config to Full. however, I still get the following error when trying to generate the pdf (Line 698 is where the code breaks) :

Access is denied
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.Win32Exception: Access is denied

Source Error:


Line 698: EO.Pdf.HtmlToPdf.ConvertHtml(HTMLforpdf, response.OutputStream)
Line 699:
Line 700: response.End() 'close the response


Source File: C:\Domains\rsvpmeonline.co.za\wwwroot\Modules\aw_mod_ArticleFull.ascx.vb Line: 698

Stack Trace:


[Win32Exception (0x80004005): Access is denied]
System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited) +964480
System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) +396
System.Diagnostics.Process.WaitForExit(Int32 milliseconds) +60
EO.Pdf.Internal.j6.a(Byte[] A_0, Int32 A_1) +214
EO.Pdf.Internal.j6.b(Byte[] A_0, Int32 A_1) +457
EO.Pdf.Internal.j6.c(Byte[] A_0, Int32 A_1) +180
EO.Pdf.Internal.kb.a(String A_0, Boolean A_1, String A_2) +278
EO.Pdf.Internal.kb.a() +333

[HtmlToPdfException: Convertion failed. Access is denied]
EO.Pdf.HtmlToPdfException.b(Exception A_0) +57
EO.Pdf.Internal.kb.a() +1153
EO.Pdf.HtmlToPdf.a(kb A_0) +24
EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options) +46
EO.Pdf.HtmlToPdf.ConvertHtml(String html, Stream stream, HtmlToPdfOptions options) +50
EO.Pdf.HtmlToPdf.ConvertHtml(String html, Stream stream) +7
Modules_aw_mod_ArticleFull.GeneratePDF(String Content, String ReportName) in C:\Domains\rsvpmeonline.co.za\wwwroot\Modules\aw_mod_ArticleFull.ascx.vb:698
Modules_aw_mod_ArticleFull.uiArticleFullSavePDFImageButton_Click(Object sender, ImageClickEventArgs e) in C:\Domains\rsvpmeonline.co.za\wwwroot\Modules\aw_mod_ArticleFull.ascx.vb:661
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
System.Web.UI.WebControls.ImageButton.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) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


My code, in part, is:

Code: Visual Basic.NET
Private Sub GeneratePDF(Content As String)

        'Set the response header
        Dim response As HttpResponse = HttpContext.Current.Response

        'Convert to the output stream
        Dim HTMLforpdf As String

        HTMLforpdf = Content

        'Page Numbering
        EO.Pdf.HtmlToPdf.Options.FooterHtmlFormat = "<p style=""font-family: Verdana, Arial, Helvetica, sans-serif;	color: #333333;	font-size: 8pt;	text-align: right;"">Page {page_number} of {total_pages}<BR>" & Request.Url.ToString & "</p>"

        'Page Size and Margins
        EO.Pdf.HtmlToPdf.Options.PageSize = New System.Drawing.SizeF(8.3F, 11.7F)
        EO.Pdf.HtmlToPdf.Options.OutputArea = New System.Drawing.RectangleF(0.5F, 0.5F, 7.3F, 10.7F)


        response.Clear() 'clears current response
        response.ClearHeaders()
        response.ContentType = "application/pdf;"
        EO.Pdf.HtmlToPdf.ConvertHtml(HTMLforpdf, response.OutputStream)

        response.End() 'close the response

End Sub
eo_support
Posted: Friday, March 1, 2013 9:33:30 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

This is still a permission issue. Can you check the version of your DLL? The stack trace does not seem to match the latest DLL.

Thanks!
Leighton
Posted: Monday, March 4, 2013 2:22:27 AM
Rank: Newbie
Groups: Member

Joined: 8/24/2011
Posts: 3
Hi there,

Thanks for your quick response. The versions of dll's I have are as follows:

EO.Pdf.dll is version 3.0.76.2
EO.Pdf.Html.dll is version 3.0.40.2
EO.Web.dll is version 9.0.45.2
EO.Web.NLib.dll is version 3.0.0.0

If I remember correctly, I had to change to an older version for something in the Editor control to work. (I think it had something to do with the FileExplorerDialog and uploading images for the Editor). Any help you can offer is much appreciated.

Thank you kindly
Justin
eo_support
Posted: Monday, March 4, 2013 7:42:30 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You have a very old version. Please try to switch to the current version. We are not aware of any problem with the new version on image with the Editor. So if you still have problem, let us know and we will look into it.

Thanks!
Leighton
Posted: Monday, March 4, 2013 8:22:51 AM
Rank: Newbie
Groups: Member

Joined: 8/24/2011
Posts: 3
Hi,

All works fine now. However, I am getting the following appearing on the page where I have the Editor:

Dialog ctl00_MainContent_ctl00_uiSaveTheDatePanel_CollapseBody_Edit_FileExplorerDialog requires a license. You can purchase a license from http://www.essentialobjects.com/Order.aspx. Please refresh the page to continue. More on license.
Already have a license? See troubleshooting License problems.

Also, When I generate a pdf now, it adds a footer saying that the pdf was created by eo.pdf for .net. This was not happening before, and I do have a licence.

Thanks again for your assistance.

Regards
Justin


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.