Using Print2HTML5 OLE Automation API
To make use of Print2HTML5 OLE Automation API you need to consult your programming language or tool documentation to learn how to create and access OLE Automation objects from it. After you learn how to create OLE Automation objects in your language or tool, you can start using Print2HTML5 OLE Automation API. Basically this involves importing of Print2HTML5 OLE Automation API type library (TLB) file (p2hserver.tlb) or Interface Definition Language (IDL) file (p2hserver.idl). These files are located in Print2HTML5 SDK directory.
One of the problems using Print2HTML5 OLE Automation API from web page server scripts may be the fact that such scripts usually run under very restricted user account which may prevent the printing applications from proper working and sending document output to Print2HTML5 printer. In such a case it may be necessary to make Print2HTML5 server work under another user or administrator account with proper rights. This may be achieved with Setting up Automation Object User Account.
Below is the instruction on how to use Print2HTML5 Automation API from VBScript but this discussion and involved API usage technique pertains to other languages as well. The Print2HTML5 Automation API Reference contains comprehensive documentation for all languages and API usage samples for VBScript.
Using Print2HTML5 Automation API from VBScript
Using Print2HTML5 Automation API from VBScript is, perhaps, the easiest and fastest way to start using this API as it does not involve using type libraries. VBScript can be used in Windows Script Host environment to run script directly from Windows Shell, from web pages or from ASP scripts. Below we'll consider creating scripts for Windows Script Host as the simplest way to explore Print2HTML5 Automation API.
First, you need to create a Print2HTML5 Server object in this way:
Similarly, you may write additional code using Print2HTML5 Automation API Reference documentation and samples from there and test it by saving the code as .vbs files and launching the script.