marked-renderer-pdf-browser

0.0.6 • Public • Published

marked-renderer-pdf-browser

A prepared build of marked-renderer-pdf for generating PDFs from markdown in browser.

This package is generated as part of CI/CD of marked-renderer-pdf.

License

MIT

Installation

npm install marked-renderer-pdf-browser

Usage

When using WebPack the converter may be imported using

import MarkdownToPDF from "marked-renderer-pdf-browser";

In addition the script may be injected using <script>-tag:

<script type="text/javascript" src="/url/to/project/node_modules/marked-renderer-pdf-browser/main.js"></script>

This will expose the converter in global variable MarkdownToPDF.

In either case you may use the converter like this:

MarkdownToPDF.convertString( yourMarkdownString )
  .then( function( pdf ) {
    // TODO: process your PDF, e.g. like this:
    domAElement.href = URL.createObjectURL( new Blob( [pdf], {
      type: "application/pdf",
    } ) );
  } );

Readme

Keywords

none

Package Sidebar

Install

npm i marked-renderer-pdf-browser

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

600 kB

Total Files

4

Last publish

Collaborators

  • soletan