Welcome Guest Search | Active Topics | Sign In | Register

HtmlToPdf.ConvertUrl returning ClientDisconnectedToken = 'HttpContext.Current.Response.ClientDisconnectedToken' threw an Options
katie
Posted: Thursday, September 13, 2012 5:27:02 AM
Rank: Member
Groups: Member

Joined: 12/7/2007
Posts: 21
I am trying to convert a URL to PDF and have setup the following code:

Code: C#
var doc = new PdfDocument();

        HtmlToPdf.Options.PageSize = PdfPageSizes.A4;
        HtmlToPdf.Options.OutputArea = new RectangleF(1f, 0.2f, 7.5f, 10.8f);

        string strURLPDF = "http://www.google.com";
        HtmlToPdfResult result = HtmlToPdf.ConvertUrl(strURLPDF, doc);

HttpResponse response = HttpContext.Current.Response;
        response.Clear();
        response.ClearHeaders();
        response.ContentType = "application/pdf";
        doc.Save(response.OutputStream);
        response.End();


But I get this error:

0x800a139e - Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12002

or when I debug through and look at the Response I can see this:
ClientDisconnectedToken = 'HttpContext.Current.Response.ClientDisconnectedToken' threw an exception of type 'System.PlatformNotSupportedException'

I have this working on another application, and I can't work out why this would not work with this. I am using Visual Studio 2012 would this cause it to fail?

Thanks
eo_support
Posted: Thursday, September 13, 2012 9:18:37 AM
Rank: Administration
Groups: Administration

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

I do not believe this error has anything to do with our product. You can Google the error message online and you should be able to find plenty of information about this one.

Thanks!


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.