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.
Unfortunately, activation email could not send to your email. Please try again.

HtmlConverter error Win 2003

Thread ID:

Created:

Updated:

Platform:

Replies:

96724 Sep 30,2010 04:19 PM Nov 15,2010 07:21 AM ASP.NET Web Forms (Classic) 9
loading
Tags: PDF
Diogenes Lima
Asked On September 30, 2010 04:19 PM

Hi,

I am using the Syncfusion.HtmlConverter class for convert html to image. After this conversion, loads the image for PdfImage and add to the PDF document.

In versions of Windows XP works perfectly but in an environment with Windows 2003 a crash occurs in this Syncfusion.HtmlConverter class, ConvertToImage method . From what I could observe is no fired the ActiveX events, and thus the loops where they have Application.DoEvents () application crashes and never returns.

The code is being executed by an ASP.NET application and I can not give more permissions than those available to the IIS user.

Thanks.


Pravin Joshua D [Syncfusion]
Replied On October 4, 2010 04:43 AM

Hi Diogenes,

Thank you for using Essential PDF.

We are unable to reproduce the issue on our side. Could you please provide us more details regarding the issue and a simplified form of the sample. This will help us a lot in investgating it.

Please let us know if you have any questions.

Regards,
Pravin Joshua D


Diogenes Lima
Replied On October 15, 2010 01:17 PM

Hi Joshua!

Basically, we inform the url we want to be converted to image and insert the image into the PDF. And we have two variations of the problem:

1) The situation presented above, it crashes on line 827 of th class Syncfusion.HtmlConverter.HtmlConverter, version 6.3.1.8.
2) When instantiating the Syncfusion.HtmlConverter.HtmlConverter has the error on line 1103, SetUIHandler method because the browser (m_webBrowser.GetOcx ()) did not return any value.

These two conditions prevent the system we are developing is approved.

using (Syncfusion.HtmlConverter.HtmlConverter html = new Syncfusion.HtmlConverter.HtmlConverter())
{
using (System.Drawing.Image img = html.ConvertToImage(url, ImageType.Metafile, (int)width, -1, AspectRatio.KeepWidth))
{
PdfImage metafile = (PdfMetafile)PdfImage.FromImage(img);
doc.PageSettings.Height = img.Height;
format.SplitTextLines = true;
metafile.Draw(page, new System.Drawing.RectangleF(0, 0, pageSize.Width, -1), format);
}
}

Thanks.



HtmlConverter_663d2873.rar

Geetha M [Syncfusion]
Replied On October 20, 2010 07:01 AM

Hi Diogenes,

Thank you for the details.

I was able to see "ArgumentNullException" when converting HTML to image. Could you please let me know if you are able to see the same exception with v6.3.1.8? Also, this exception has been fixed and I am not able to reproduce in our recent public release v8.3.0.21. Could you please consider upgrade to this version?

http://www.syncfusion.com/downloads/latest-version

Regards,
Geetha


Diogenes Lima
Replied On October 21, 2010 09:57 AM

Hi,

As suggested, I did download the new version of Syncfusion to conduct further tests. Tests were conducted based on design examples of the new version (Syncfusion \ Essential Studio \ 8.3.0.21 \ Windows \ Pdf.Windows \ Samples \ 2.0 \ Import and Export \ HTML to PDF \ HTMLToPDF_2008).

The application of tests, HTMLToPDF_2008, worked both in the development environment as the environment we have to simulate the staging environment (Windows 2003). Now if we run our application on Windows 2003 is fired the following exception:

Message: Start Conversion Object reference not set to an instance of an object.
StackTrace: In Syncfusion.HtmlConverter.HtmlConverter.GetImagesFromUrl (String url, ImageType type)
In Syncfusion.HtmlConverter.HtmlConverter.Convert (String url, ImageType type, Int32 width, Int32 height, AspectRatio aspectRatio ).....

using (Syncfusion.HtmlConverter.HtmlConverter html = new Syncfusion.HtmlConverter.HtmlConverter())
{
html.EnableJavaScript = false;
using (Syncfusion.Pdf.HtmlToPdf.HtmlToPdfResult result = html.Convert(url,ImageType.Metafile, (int)width, -1, AspectRatio.KeepWidth))
{
if (result.RenderedImage != null)
{
PdfMetafile mf = new PdfMetafile(result.RenderedImage as Metafile);
mf.Quality = 100;
doc.PageSettings.Height = result.RenderedImage.Size.Height;

result.Render(page, format);
}
}
}
The exception occurs in HtmlToPdfResult: using (Syncfusion.Pdf.HtmlToPdf.HtmlToPdfResult result = html.Convert(url,ImageType.Metafile, (int)width, -1, AspectRatio.KeepWidth)).

The ASP.NET application makes access to a service in all the ASPX pages to access information in the database. The IIS configuration is with Anonymous access (False) and Integrated Windows authentication (True).

I think the difference is the user that opens the process to convert the html.

Thanks.


Geetha M [Syncfusion]
Replied On October 25, 2010 08:36 AM

Hi Diogenes,

Thank you for the details.

I am afraid that I am not able to reproduce the problem in Windows 2003. I have placed my test sample in the link below. Could you please modify it and send back to us so that we can check and get back to you?

F96724.zip

Regards,
Geetha


Diogenes Lima
Replied On October 25, 2010 02:51 PM

Hi,

I Adapted the application as close as possible that of is done:

VS 2008 +. NET 3.5

Attached is the test application.

Thanks.



F967241664901125_311b2371.rar

Geetha M [Syncfusion]
Replied On October 28, 2010 08:42 AM

Hi Diogenes,

Thank you for your patience.

I was not able to reproduce the problem in Win 2003 machine with the modified sample. Could you please send me the stack trace so that I can check and get back to you?

Regards,
Geetha


Diogenes Lima
Replied On November 11, 2010 07:24 AM

Hi,

For what seems the problem is linked to the standard version of IE that comes installed with Windows 2003.

We'll do some tests to confirm this hypothesis.

We appreciate the help and if the problem persists, we will contact you.

Thanks.


Selvakumar P [Syncfusion]
Replied On November 15, 2010 07:21 AM

Hi Diogenes,

Thanks for the Update. We are pleased to help you.

Regards,
Selvakumar.



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;