Posted under features on September 18 , 2019 by Nidhisha Shetty
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:
<sk:Replace tag="Name_tag"></sk:Replace>.
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:
Syntax:
<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>
For example:
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.
TAGGED:HTMLPDFWkhtmltopdf
7th floor, Unit No. 715, C Wing,
Kailas Business Park, S. Veer Savarkar Marg,
Park Site, Vikhroli (W), Mumbai-400079.