Nine Pedestrians Mesmerized

    html2pdfmake
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.7 • Public • Published

    html2pdfmake

    Parse HTML/DOM to pdfmake.

    Install

    npm i html2pdfmake
    yarn add html2pdfmake

    Usage

    <div id="template">
        <p>Text</p>
    </div>
    <script type="module">
    import {parse} from 'https://cdn.jsdelivr.net/npm/html2pdfmake/dist/html2pdfmake.mjs';
    const {content, images, patterns} = parse(document.getElementById('template'));
    
    pdfMake.createPdf({
      // everything else
      content,
      images,
      patterns
    })
    </script>

    NodeJS

    Install a HTML parser like JSDOM.

    Run examples

    npm i http-server -g
    npm i
    npm run watch
    # open new terminal
    http-server .
    # open localhost:8080

    Install

    npm i html2pdfmake

    DownloadsWeekly Downloads

    1

    Version

    0.0.7

    License

    ISC

    Unpacked Size

    331 kB

    Total Files

    143

    Last publish

    Collaborators

    • dantio