We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

HTML to PDF under IIS problems

Hey,

I've some problems using standard code for converting HTML to PDF under IIS 7 on Vista:

2008-05-30 16:30:42,373 [7] ERROR HtmlLib.Converter [(null)] - Exception occured: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Syncfusion.HtmlConverter.Native.OleDraw(Object pUnkn, Int32 dwAspect, IntPtr hDC, Rectangle& R)
at Syncfusion.HtmlConverter.HtmlConverter.ConvertToMetafile2()
at Syncfusion.HtmlConverter.HtmlConverter.ToImage(ImageType type)
at Syncfusion.HtmlConverter.HtmlConverter.ConvertToImage(String url, ImageType type)
at Syncfusion.HtmlConverter.HtmlConverter.ConvertToImage(String url, ImageType type, Int32 width, Int32 height, AspectRatio aspectRatio)
at HtmlLib.Converter.Convert(string Url)

This only happens if there are several (I've tested with 5) clients working simultaneously.
I use Microsoft Web Application Stress Tool.
And if I start 5 threads requesting the page after sometime error occur in log file.

Any thoughts? Is it safe to use your components under IIS ?




10 Replies

AD Administrator Syncfusion Team May 30, 2008 08:57 PM UTC

Some times error is:
2008-05-30 16:54:01,884 [5] ERROR HtmlLib.Converter [(null)] - Exception occured: Parameter is not valid.
System.ArgumentException: Parameter is not valid.
at System.Drawing.Imaging.Metafile.GetMetafileHeader()
at Syncfusion.Pdf.Graphics.PdfMetafile.AdjustMetafile(Metafile metafile)
at Syncfusion.Pdf.Graphics.PdfMetafile..ctor(Metafile metafile)
at Syncfusion.Pdf.Graphics.PdfImage.FromImage(Image image)
at HtmlLib.Converter.Convert(string url)

I use VS 2008, .NET 2.0, and Essential Studio 6.3.0.6

Anton




AD Administrator Syncfusion Team May 30, 2008 09:03 PM UTC

And sometimes error is:
2008-05-30 16:54:02,191 [4] ERROR HtmlLib.Converter [(null)] - Exception occured: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.DoEvents()
at Syncfusion.HtmlConverter.HtmlConverter.ToImage(ImageType type)
at Syncfusion.HtmlConverter.HtmlConverter.ConvertToImage(String url, ImageType type)
at Syncfusion.HtmlConverter.HtmlConverter.ConvertToImage(String url, ImageType type, Int32 width, Int32 height, AspectRatio aspectRatio)
at HtmlLib.Converter.Convert(string url)

May be this will help you.

Anton



SS Sri Subhashini M Syncfusion Team June 2, 2008 12:34 PM UTC

Hi Anton,

Thank you for using Syncfusion product.

I am afraid that I was not able to reproduce the issue. Please look into the screen shot which is taken from MS web stress tool.

http://www.syncfusion.com/support/user/uploads/SampleImage_56240c45.zip

Could you please send us the reproducing steps with the html files so that we could sort out the cause of the issue and provide you a solution.

Regards,
Suba




AD Administrator Syncfusion Team June 2, 2008 04:22 PM UTC

Hi Suba!

About your screenshot - it seems that majority of requests sent haven't even been executed - 5394 requests got 403 error, 493 request result code wasn't given (may be IIS have hung up) and only 6 of them passed (you can see it section Result codes in your report).
I've attached my samples may be it will help you to reproduce error. It converts yahoo page to pdf and saves it in C:\Pdfs folder also there is some logging added so you can see log file and all errors there.

Hope this will help. I've tried with different frameworks 2.0 and 3.0 with identical results received. Please note that I use Windows Vista Business Edition and IIS7, VS 2008 and .NET Framework 2.0(also I've tried on .NET Framework 3.0)

Anton



Sources_7044ea6a.zip


AD Administrator Syncfusion Team June 3, 2008 02:02 PM UTC

Any news?
Have you reproduced the issue?



SS Sri Subhashini M Syncfusion Team June 4, 2008 06:51 AM UTC

Hi Anton,

I have uploaded a wrong screen shot. Sorry for the inconvenience caused.

Still, I fear that I was not able to reproduce the issue in our testing environment. I have used 2 thread, 200 users in stress tool and it generates 366 pdf report without any issues.

Please do find the stress tool generated report from the below specified link.

http://www.syncfusion.com/support/user/uploads/ReportData_88951090.zip

Note : Please ensure the interop assemblies[AxSHDocVw.dll,SHDocVw.dll] is avaliable in GAC.

Regards,
Suba



AD Administrator Syncfusion Team June 4, 2008 12:54 PM UTC

Have you checked using the site www.yahoo.ca?

Thanks for your time.

Anton



SS Sri Subhashini M Syncfusion Team June 5, 2008 12:18 PM UTC

Hi Anton,

Yes, I have checked with the website ‘www.yahoo.ca’. Please look into the generated report from the below specified link.

http://www.syncfusion.com/support/user/uploads/0e93d442-5573-43f8-8714-964f7b25557c_e4d194d6.zip

If still the issue exists, could you please update us with screenshot or video clip so that we could sort out the issue and provide you the solution.

Regards,
Suba




AD Administrator Syncfusion Team June 5, 2008 01:35 PM UTC

Hey,

I've already sent you sources of the web site and a the log file with error. You just need to start 5 or 10 threads in Microsoft Web Application Stress Tool for this site and in a minute you'll have an error in the log file. That's all. Unfortunately, I do not have time to record a video for you, but I think it is a pretty simple to do this. The error is stable so it is reproducible every time I start the test. And this happens only with the site www.yahoo.ca, with google everything works good. Please try to reproduce it on the machine running Vista that has 2 Gb memory. May be the problem lies here.

Thanks,
Anton




SS Sri Subhashini M Syncfusion Team June 6, 2008 09:45 AM UTC

Hi Anton,

Could you please try the issue with the our development build which is available on or before Tuesday.

Please let me know if you need any other concerns.

Regards,
Suba



Loader.
Live Chat Icon For mobile
Up arrow icon