Table of Contents
- Getting Started
- EO.Pdf
- EO.Web
- EO.WebBrowser
- EO.Wpf
- Common Topics
- Reference EO.Total Dlls
- Adding EO controls to Visual Studio Toolbox
- Deployment
- Collecting Runtime Logs
- Collecting Crash Report
- Using DebugTools
- Using eowp.exe
- Troubleshooting Child Process Error
- Using EO.WebEngine JavaScript Interface
- Using with .NET Core (including .NET 5 and newer)
- Choosing between x86 build and x64 build
- Reference
EO.WebEngine JavaScript Interface |
EO.WebEngine (used by both EO.WebBrowser and EO.Pdf) defines a global variable "eoapi". This variable is available in every page as a native browser object. You can use this object to perform the following tasks:
Checking Whether Inside EO.WebEngine
Because variable eoapi only exists when the page is running inside EO.WebEngine, you can check whether the page is running inside EO.WebEngine by checking whether variable eoapi exists. If variable eoapi exists, then the page is running inside EO.WebEngine. If variable eoapi does not exist, then the page is being rendered by a regular Web browser.
The following code demonstrates how to check whether eoapi exists:
//Check whether the page is running inside EO.WebEngine if (typeof(eoapi) == "object") { //Variable eoapi exists. So we are inside EO.WebEngine ..... } else { //Variable eoapi does not exist. So we are inside a //regular Web browser }
Checking EO.WebEngine Version
Call getVersion on eoapi to return EO.WebEngine converter version number as a string (for example, "16.0.15.0"). The following JavaScript code outputs EO.WebEngine version number:
//Output EO.WebEngine version number if (typeof(eoapi) == "object") document.write("EO.WebEngine version number: " + eoapi.getVersion());
Triggering Conversion Manually
Please see here for more details on triggering HTML to PDF conversion manually.
Calling .NET Code
Please see here for more details on triggering calling .NET code from JavaScript.