CoolUtils Logo
German  Italian  Dutch  Spanish  Russian

How To Convert HTML Files on Server/Service/ActiveX

content
You may also convert HTML files on web-servers or services with the help of Total HTML Converter X (SDK).

General Description

Total HTML Converter X includes:

  • Command line converter;
  • ActiveX.

Advantages of Total HTML Converter X are the following:

  • Ideal for on web-servers, it has no GUI or any popups to interrupt the process;
  • Convert HTML files and HTML strings to PDF, DOC, XLS, JPG and Text file formats;
  • Batch conversion;
  • Automatic work;
  • The possibility to build the custom applications with the help of Active X.

Note: Pay attention to some details during installation Total HTML Converter X:

  • Do not forget to register ActiveX in your web-server account.
  • Total HTML Converter X supports only Internet Explorer, Mozilla and Firefox browsers.
  • ActiveX works only with 32-bit internet information server. 64-bit server is not supported. Use command line version instead.

You may have a look at the examples of ASP and PHP below.

Example ASP:

dim C
Set C=CreateObject("HTMLConverter.HTMLConverterX")
C.Convert "c:\source.HTML", "c:\dest.JPG", "-cJPG"
set C = nothing
Example2 ASP: directly stream the resulting PDF
dim C
Set C=CreateObject("HTMLConverter.HTMLConverterX")
Response.Clear
Response.AddHeader "Content-Type", "binary/octet-stream"
Rresponse.AddHeader "Content-Disposition", "attachment; filename=test.pdf"
Response.BinaryWrite c.ConvertToStream("C:\www\ASP\Source.html", "C:\www\ASP", "-cpdf")
set C = nothing
Example PHP:
$src="C:\test.htm";
$dest="C:\test.pdf";
if (file_exists($dest)) unlink($dest);
$c= new COM("HTMLConverter.HTMLConverterX");
$c->convert($src,$dest, "-c pdf");
if (file_exists($dest)) echo "OK"; else echo "fail:".$c->ErrorMessage;

Registration Total HTML Converter X on the Server

Usually internet information server works under default account which is not the administrator's one. When you try to use our dll Explorer can not open the page or server hang up. You receive request page time out message.

To settle this problem do the following:

  • Login the account where internet server runs.
  • Register ActiveX:
    • Reinstall Total HTML Converter X.
    • Enter regsvr32 C:\YourPath\HTMLConverter.dll in command line.
  • Make sure the dll was registered. Convert any HTML file with the file: axHTMLDev.exe. If it converts without any problems ActiveX was successfully installed on your system.
  • Run htmlconveterx.exe.
  • Click 'Register' button and enter the key you have received by e-mail after purchasing the product.

Note: To register Total HTML Converter X on the server you must have the administrator rights.

How To Call HTML ConverterX ActiveX via ColdFusion on Windows

If you run ColdFusion on Windows you may also convert HTML files:

  • Call HTML Converter X with the help of ActiveX interface.
  • The interface is provided in the form of an ActiveX DLL file.
  • Register the file in the Windows registry using REGSVR32.EXE:

    regsvr32 C:\HTMLConverterX\HTMLConverter.dll

  • To call HTML Converter from Cold Fusion create a COM object using 'Create Object' function. It is available in CFML scripting. You may also use the <cfobject ...>.
  • Once the COM object is created you can use the COM interface methods to perform the tasks.

Below you may see the examples:


CFML

<cfscript>
   pr = CreateObject("Com", "HTMLConverter.HTMLConverterX", "local");

   if (pr.Convert("C:\examples\magic.html", "C:\output.pdf", "-c PDF") eq 1)
      WriteOutput("Successful");
   else
      WriteOutput("Unsuccessful");

   ReleaseComObject(pr);
</cfscript>
Site Map  |  Contacts |  Press Center | Resellers | About |  Privacy Policy |    Copyright © 1998-2018 CoolUtils Development. All rights reserved.   GPlus