This sample shows how to run a script before converting HTML to PDF in C# or VB.NET application.
The Execute JavaScript before conversion section contains additional information.
Sometimes it is required to run a script after the page is loaded but before it is converted. For example, to toggle elements, or to make dynamic content loading happen.
You can specify the script to run in conversion start options inside the HtmlConversionOptions
. Then pass the options to the CreatePdfAsync
method.
This sample code uses free Docotic.Pdf.HtmlToPdf add-on for Docotic.Pdf library.