Create dynamic HTML To PDF with help of Mustache JS.
Create a simple template
<h2>Hello {{name}}</h2> <small>You have just won {{amount}}!</small> <p>Well, {{text}}, after taxes.</p> In the above template the fields within the curly braces ({{}}) can be: keys of a Map object
<h2>Hello {{name}}</h2> <small>You have just won {{amount}}!</small> <p>Well, {{text}}, after taxes.</p>
Hello
You have just won
amount
Well, {{text}}, after taxes.
{{text}}
In the above template the fields within the curly braces ({{}}) can be:
keys of a Map object
Given the following hash:
{ "name": "Chris", "amount": "10000 dollars", "text": "6000.0 dollars" }
10000 dollars
text
6000.0 dollars
Will produce the following:
Hello Chris You have just won 10000 dollars! Well, 6000.0 dollars, after taxes.
improve some enhancements and remove unused dependencies.