Table of Contents
- Getting Started
- EO.Pdf
- Overview
- Installation and Deployment
- Using HTML to PDF
- Using HTML to PDF
- Quick Start
- Setting Page Size and Margins
- Resizing Output
- Output Paging
- Web Page Authentication
- HTTP Post and Headers
- JavaScript in HTML
- Conversion Trigger
- Links in HTML
- Page Header and Footer
- Partial Page Conversion
- Repeating Table Header and Footer
- Merging Multiple HTML pages
- Generating Page Images
- Using with PDF Creator
- Creating Interactive Form Elements
- Working with Secure Pages
- Using HtmlToPdfSession object
- Troubleshooting HTML to PDF
- Debugging HTML to PDF
- Using PDF Creator
- Working with Existing PDF Files
- Using in Web Application
- Advanced Topics
- EO.Web
- EO.WebBrowser
- EO.Wpf
- Common Topics
- Reference
Javascript in HTML |
Overview
By default, all Javascript code in the HTML is automatically executed the same way as they are loaded by a browser for viewing. This ensures the final render result is the same as viewed in a browser.
However if you wish to turn off Javascript, you can set HtmlToPdfOptions's NoScript to true. When this property is set to true, all Javascript code will be ignored. This can speed up the converting process, but the final result maybe different because scripts are not executed.
Some Web pages automatically generate/update the page or a portion of the page with Javascript after it loads. For example, a financial Web site may load the main contents right away but loads the real time stock quotes through a separate AJAX request. In order for the converter get a full "picture" of the Web page in such cases, it must wait long enough to give such scripts a chance to run. HtmlToPdfOptions's MinLoadWaitTime is introduced for this purpose. This property controls the minimum amount of time the converter should wait before the actual conversion starts.
Debug Console
EO.Pdf HTML to PDF converter can display debug or error message output from your JavaScript code. In order to trace such messages, you can set HtmlToPdf.DebugConsole to a TextWriter object. For example, the following code uses the standard output stream as the debug output console:
//Use the standard output console as the debug console
HtmlToPdf.DebugConsole = Console.Out;
With the above code, you can use the following code in your JavaScript to output debug message:
//Output debug message to the debug console console.log("some debug message");
If an error occurred in your JavaScript code, the error message will also be outputted to the debug console.