hajareshyam / pdf-creator-node

This package is used to generate HTML to PDF in Nodejs
MIT License
238 stars 79 forks source link
html-pdf html-template node pdf pdf-converter pdf-creator pdf-generation

Follow these steps to convert HTML to PDF

If Conditional Checks

You can do conditional checks by calling helper block ifCond example

{{#ifCond inputData "===" toCheckValue}}
  <!DOCTYPE html>
  <html>
    <head>
      <meta charset="utf-8" />
      <title>Hello world!</title>
    </head>
    <body>
      <h1>User List</h1>
      <ul>
        {{#each users}}
        <li>Name: {{this.name}}</li>
        <li>Age: {{#ifCond this.age '===' '26'}}</li>
        <br />
        {{/ifCond}}
        {{/each}}
      </ul>
    </body>
  </html>

Can check variables with different type ie string, integer, boolean, double

Other logical operators are-:

NOTE!!

You can only match 2 variables

End

License

pdf-creator-node is MIT licensed.