|
Rank: Newbie Groups: Member
Joined: 2/27/2015 Posts: 7
|
Support,
Occasionally we get the following errors when generating web pages using EO.pdf:
System.IO.IOException: The handle is invalid. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count) at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count) at EO.Pdf.Internal.b4.a(Stream A_0) at EO.Pdf.Internal.hh.a(Stream A_0) at EO.Pdf.Internal.hh.b(String A_0) at ARRT.Utilities.PDFutil.GenerateConfPagePDF(String html, String filename, Boolean resize, Boolean removeImages) at Renewal_Confirmation.Page_Load(Object sender, EventArgs e)
Could you tell us how to stop these errors from occurring?
Using EO.PDF version 4.0.41.2
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
This can happen if you pass a Stream object to our converter and the Stream object has been closed/disposed before EO.Pdf has finished writing to the stream.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 2/27/2015 Posts: 7
|
Thanks, one last question.
If it's because the stream object has been closed, why would that be?
Is the scenario when someone lets the page partially load and they close out their browser?
We are not ending the stream, so what causes the stream to close or dispose before it's done?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
It would depends on what kind of Stream object. Do you see anything in between:
EO.Pdf.Internal.hh.b(String A_0)
And
ARRT.Utilities.PDFutil.GenerateConfPagePDF(String html, String filename, Boolean resize, Boolean removeImages)
In your stack trace?
It is not possible for your GenerateConfPagePDF to call EO.Pdf.Internal.hh.b directly.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 2/27/2015 Posts: 7
|
Here is the code.
We don't specifically have any stream objects. Just an HTML string we pass to this:
HtmlToPdfOptions options = new HtmlToPdfOptions(); if (resize) options.ZoomLevel = 0.8f; options.NoLink = true; options.NoScript = true; options.NoCache = true; options.PageSize = PdfPageSizes.A4; PdfDocument doc = new PdfDocument(); doc.EmbedFont = false; HtmlToPdf.ConvertHtml(html, doc, options);
It looks like the last line HtmlToPdf.ConvertHtml(html,doc,options) is actually what calls: EO.Pdf.Internal.hh.b(String A_0)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
Can you still provide the full stack trace?
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 2/27/2015 Posts: 7
|
It is in the first post of this message, or where you looking for something else?
The ARRT.Utilities.PDFutil.GenerateConfPagePDF code contains the code I posted on Feb 27 @ 4:17PM:
HtmlToPdfOptions options = new HtmlToPdfOptions(); if (resize) options.ZoomLevel = 0.8f; ..... .....
Let me know what else you need.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
Something is missing in between:
EO.Pdf.Internal.hh.b(String A_0)
And
at ARRT.Utilities.PDFutil.GenerateConfPagePDF
Because it is not possible for your GenerateConfPagePDF to call our Internal.hh.b directly. The stack trace should the ConvertHtml call. That's why we were asking for the full stack trace. Can you check why it's missing?
Thanks!
|
|