HTML file is created with the help of an HTML template using ExportToHtml() function. The HTML file is then converted into PDF file using wkhtmltopdf tool.
ExportToHtml() function is used to generate HTML file from HTML template.
ExportToHtml() function accepts the following arguments:
For example: Name_tag is the static tag in the following code line:
RepeatTags: Array or range of repeating tag names. (Provide the tag names whose fields are to be repeated.) For example: repeat_tag is the repeat tag in the following code line:
ReportTags1: Array or range of tags in the first repeat range. (Provide the tags to be exported to html file as a header to the list or table.). For example: column_1 and column_2 are the report tags (ReportTags1) within the first repeat tag as shown in the following code block:
Here the column fields are to be repeated within table having repeat tag as table_tag.
HTML file can be converted to PDF file using wkhtmltopdf tool.
Following are the steps to convert HTML file to PDF file:
<Path to wkhtmltopdf.exe file> --page-size <Letter|A4> --header-html <path to html header file> --header-spacing <header spacing value> --footer-html <path to html footer file> --margin-bottom <bottom spacing value> <path to input HTML file> <path to output PDF file>
wkhtmltopdf.exe --page-size Letter --header-html "header.html" --header-spacing 15 --footer-html "footer.html" --margin-bottom 25 --header-spacing 15 *Input_html.html* *Output_PDF.pdf*
For more information on wkhtmltopdf arguments refer to the following link: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt.
February 06, 2020 bySwanand Nirgudkar
For generating custom reports with complex formatting rules, SheetKraft's ExportToExcel Using…Continue Reading
February 02, 2020 bySwanand Nirgudkar
A quick reference for exporting to an XML document through SheetKraft Any form of organized or…Continue Reading
January 20, 2020 bySwanand Nirgudkar
While running an automated process, there may arise a need for the user to get some assistance on…Continue Reading