Posted by a ceTe Software moderator
Hello Matt,
No problem, we can address this issue in this forum since it’s the same product. These errors are thrown by the ASP.NET when calling the Response.Flush() method if the user cancels the request while the file is being streamed to the client browser. Check out this
link for more details. These errors can be caused if you stream any file in the server side code.
The DrawToWeb of our API streams the PDF file to the browser as explained in the above link, and it does check for Response.IsClientConnected before the Flush method is called. You could try the solution suggested in this
link or you can use the file streaming code show in the below sample as a workaround instead of using the DrawToWeb method.
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
TextArea textArea = new TextArea("This is the underlined " + "text of a TextArea", 100, 100, 400, 30,ceTe.DynamicPDF.Font.HelveticaBoldOblique, 18);
textArea.Underline = true;
page.Elements.Add(textArea);
byte[] byteData= document.Draw();
this.Response.ClearHeaders();
this.Response.ClearContent();
this.Response.ContentType = "application/pdf";
this.Response.Charset = string.Empty;
this.Response.AddHeader("Content-Disposition", "inline; filename=" + "HelloWorld.pdf ");
this.Response.BinaryWrite(byteData);
Thanks,
ceTe Software Support Team.