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.

Error with HtmlConverter class

Thread ID:

Created:

Updated:

Platform:

Replies:

45439 Jun 21,2006 03:59 AM May 12,2009 06:56 AM ASP.NET Web Forms (Classic) 11
loading
Tags: PDF
manoj singh
Asked On June 21, 2006 03:59 AM

Hi, I have downloaded source code provided for "WebPageToPDF" conversion. I am using .NET 2.0 for my project and I am facing problem with "HtmlConverter" class. As soon as my code reaches to "HtmlConverter" class, it gives me exception as below.. System.IO.FileNotFoundException was unhandled by user code Message="Could not load file or assembly ''''AxSHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89'''' or one of its dependencies. The system cannot find the file specified." Source="Syncfusion.HtmlConverter.Base" FileName="AxSHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" FusionLog="Assembly manager loaded from: C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\mscorwks.dll\r\nRunning under executable C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\WebDev.WebServer.EXE\r\n--- A detailed error log follows. \n\r\n=== Pre-bind state information ===\r\nLOG: User = MUMBAI\\ravikumar.katragadda\r\nLOG: DisplayName = AxSHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89\n (Fully-specified)\r\nLOG: Appbase = file:///C:/Inetpub/wwwroot/WebSite1/\r\nLOG: Initial PrivatePath = C:\\Inetpub\\wwwroot\\WebSite1\\bin\r\nCalling assembly : Syncfusion.HtmlConverter.Base, Version=4.202.0.31, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: Using application configuration file: C:\\Inetpub\\wwwroot\\WebSite1\\web.config\r\nLOG: Using machine configuration file from C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\config\\machine.config.\r\nLOG: Post-policy reference: AxSHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89\r\nLOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/website1/6746a9b5/a49de883/AxSHDocVw.DLL.\r\nLOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/website1/6746a9b5/a49de883/AxSHDocVw/AxSHDocVw.DLL.\r\nLOG: Attempting download of new URL file:///C:/Inetpub/wwwroot/WebSite1/bin/AxSHDocVw.DLL.\r\nLOG: Attempting download of new URL file:///C:/Inetpub/wwwroot/WebSite1/bin/AxSHDocVw/AxSHDocVw.DLL.\r\nLOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/website1/6746a9b5/a49de883/AxSHDocVw.EXE.\r\nLOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/website1/6746a9b5/a49de883/AxSHDocVw/AxSHDocVw.EXE.\r\nLOG: Attempting download of new URL file:///C:/Inetpub/wwwroot/WebSite1/bin/AxSHDocVw.EXE.\r\nLOG: Attempting download of new URL file:///C:/Inetpub/wwwroot/WebSite1/bin/AxSHDocVw/AxSHDocVw.EXE.\r\n" StackTrace: at Syncfusion.HtmlConverter.HtmlConverter..ctor() at HTMLImage.Convert() in c:\Inetpub\wwwroot\WebSite1\HTMLImage.aspx.cs:line 63 at HTMLImage.Button1_Click(Object sender, EventArgs e) in c:\Inetpub\wwwroot\WebSite1\HTMLImage.aspx.cs:line 30 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) kindly suggest me what could be the problem and where i am doing wrong. thanks & regards, manoj singh.

Ajish [Syncfusion]
Replied On June 21, 2006 07:24 AM

Hi Manoj, Thank you for your interest in Esssential PDF. The HTMLConverter uses the MSHTML rendering library to render HTML documents. The MSHTML library is the engine that is used to drive the Internet Explorer. It can he used in Asp.net environment. Here are some things that has to be done under Asp.net environment. 1) Add to the @Page directive AspCompat="true" attribute to the page where we want to perform html to pdf convertion. 2) Reference the "AxInterop.SHDocVw.dll" assembly to the project. Here is a sample for converting a webpage to PDF using Asp.net 2.0: ConvertWebPageToPDF Please take a look and let me know if you have any queries. Thanks, Ajish.

Sean
Replied On October 21, 2006 03:07 PM

I get the same error but when I try to reference AxInterop.SHDocVw.dll (copied from your example into the bin directory...I couldn't find this under "Add Reference..." in VS2005 on either the .NET or the COM tabs) I get a JIT Debugger error:

System.IO.FileNotFound in [temp project path]

Do I need a special using statement?

Dhivya K [Syncfusion]
Replied On October 22, 2006 04:27 AM

Hi Sean,

Thank you for our interest in Essential PDF.

You have to manually refer these assemblies by selecting "Browse" tab and locate the assemblies from bin folder. These assemblies cannot be found by default in public assemblies.Thats why you couldn't refer them through .Net tab.

Could you please refer these assemblies and add @Page directive AspCompat="true" and let me know if the problem still exist?

Here is a sample for your reference:
http://www.syncfusion.com/Support/user/uploads/ConvertToPDF_bfd9ccdf.zip

Please take a look into it and let me know if you have any questions.

Regards,
Dhivya.

Administrator [Syncfusion]
Replied On October 22, 2006 12:35 PM

I did add the references using Browse.... I debugged the app and checked the Fusion log where this was found:

"Assembly manager loaded from: C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\mscorwks.dll\r\nRunning under executable C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_wp.exe\r\n--- A detailed error log follows. \n\r\n=== Pre-bind state information ===\r\nLOG: User = QUICKDRAW\\ASPNET\r\nLOG: DisplayName = AxSHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89\n (Fully-specified)\r\nLOG: Appbase = file:///c:/inetpub/wwwroot/aboda/\r\nLOG: Initial PrivatePath = c:\\inetpub\\wwwroot\\aboda\\bin\r\nCalling assembly : Syncfusion.HtmlConverter.Base, Version=4.302.0.30, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: Using application configuration file: c:\\inetpub\\wwwroot\\aboda\\web.config\r\nLOG: Using host configuration file: C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet.config\r\nLOG: Using machine configuration file from C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\config\\machine.config.\r\nLOG: Post-policy reference: AxSHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89\r\nLOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/aboda/2e9aa854/224d7411/AxSHDocVw.DLL.\r\nLOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/aboda/2e9aa854/224d7411/AxSHDocVw/AxSHDocVw.DLL.\r\nLOG: Attempting download of new URL file:///c:/inetpub/wwwroot/aboda/bin/AxSHDocVw.DLL.\r\nWRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN\r\nERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.\r\n"

I also tried using AxImp.exe to wrap these dlls. I copied c:\windows\system32\SHDocVw.dll to a folder and ran aximp.exe which produced a new SHDocVw.dll and AxSHDocVq.dll which I then put in the /bin directory and included references in the project. This did not work.

Thanks for your help

Administrator [Syncfusion]
Replied On October 22, 2006 01:25 PM

Also, I used FuseLogVw.exe and found the following log entry:

*** Assembly Binder Log Entry (10/22/2006 @ 10:26:46 AM) ***

The operation failed.
Bind result: hr = 0x80131040. No description available.

Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_wp.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = QUICKDRAW\ASPNET
LOG: DisplayName = AxSHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89
(Fully-specified)
LOG: Appbase = file:///c:/inetpub/wwwroot/aboda/
LOG: Initial PrivatePath = c:\inetpub\wwwroot\aboda\bin
LOG: Dynamic Base = C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aboda\2e9aa854
LOG: Cache Base = C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aboda\2e9aa854
LOG: AppName = 224d7411
Calling assembly : Syncfusion.HtmlConverter.Base, Version=4.302.0.30, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\inetpub\wwwroot\aboda\web.config
LOG: Using host configuration file: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: AxSHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/aboda/2e9aa854/224d7411/AxSHDocVw.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/aboda/2e9aa854/224d7411/AxSHDocVw/AxSHDocVw.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/aboda/bin/AxSHDocVw.DLL.
LOG: Assembly download was successful. Attempting setup of file: c:\inetpub\wwwroot\aboda\bin\AxSHDocVw.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: AxSHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Could this be a security issue where the assembly is expecting to be signed (hash encrypted)?


Dhivya K [Syncfusion]
Replied On October 23, 2006 12:57 PM

Hi Sean,

I am afraid. I am unable to reproduce the issue. Could you please remove the reference from web.config and re refer the assemblies from bin folder and let me know if the problem still exist?

Regards,
Dhivya.

Pon Saravanan
Replied On April 1, 2008 08:29 PM

Hi
i have downloaded the trial pack. And tried to compile the project. i received the reference not found for htmlconvertor.

then i downloaded the trial pack back office. and got the htmlconvertor. but now it is asking me to reference the 'System.Windows.Forms.UserControl'.

if i do that it breaks exactly at
HtmlConverter html = new HtmlConverter();

pelase advice

type 'System.Windows.Forms.UserControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.




Administrator [Syncfusion]
Replied On May 10, 2009 05:07 PM

Is there a solution to this problem?

I have the same problem, and have tried what is suggested in this thread without any results.

The type 'System.Windows.Forms.UserControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Administrator [Syncfusion]
Replied On May 11, 2009 08:46 AM

Hi,

The HtmlConverter is the user control. So, while using the converter package we have to include the System.Windows.Forms.Usercontrol assembly reference in an application.

Please let us know if you need any other details.

Best Regards,
Bhuvana

Bhuvaneswari P [Syncfusion]
Replied On May 11, 2009 08:46 AM

Hi,

The HtmlConverter is the user control. So, while using the converter package we have to include the System.Windows.Forms.Usercontrol assembly reference in an application.

Please let us know if you need any other details.

Best Regards,
Bhuvana

Administrator [Syncfusion]
Replied On May 12, 2009 06:56 AM

That, of course, worked like a charm.

Thank you.

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.

;