- Home
- Forum
- ASP.NET Web Forms (Classic)
- HtmlConverter error Win 2003
HtmlConverter error Win 2003
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.
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.
SIGN IN To post a reply.
9 Replies
PJ
Pravin Joshua D
Syncfusion Team
October 4, 2010 08:43 AM UTC
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
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
DL
Diogenes Lima
October 15, 2010 05:17 PM UTC
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
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
GM
Geetha M
Syncfusion Team
October 20, 2010 11:01 AM UTC
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
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
DL
Diogenes Lima
October 21, 2010 01:57 PM UTC
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.
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.
GM
Geetha M
Syncfusion Team
October 25, 2010 12:36 PM UTC
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
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
DL
Diogenes Lima
October 25, 2010 06:51 PM UTC
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
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
GM
Geetha M
Syncfusion Team
October 28, 2010 12:42 PM UTC
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
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
DL
Diogenes Lima
November 11, 2010 12:24 PM UTC
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.
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.
SP
Selvakumar P
Syncfusion Team
November 15, 2010 12:21 PM UTC
Hi Diogenes,
Thanks for the Update. We are pleased to help you.
Regards,
Selvakumar.
Thanks for the Update. We are pleased to help you.
Regards,
Selvakumar.
SIGN IN To post a reply.
- 9 Replies
- 4 Participants
-
DL Diogenes Lima
- Sep 30, 2010 08:19 PM UTC
- Nov 15, 2010 12:21 PM UTC