Gathering detailed insights and metrics for electron-md-to-pdf
Gathering detailed insights and metrics for electron-md-to-pdf
Gathering detailed insights and metrics for electron-md-to-pdf
Gathering detailed insights and metrics for electron-md-to-pdf
:electron: Convert Markdown to PDF in Electron apps Convert Markdown to PDF in Electron apps
npm install electron-md-to-pdf
Typescript
Module System
CSS (73.08%)
TypeScript (25%)
HTML (1.93%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
35 Commits
2 Watchers
3 Branches
1 Contributors
Updated on Jan 28, 2023
Latest Version
2.2.0
Package Id
electron-md-to-pdf@2.2.0
Unpacked Size
15.89 kB
Size
5.80 kB
File Count
8
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1
19
Convert Markdown to PDF in Electron apps
This simple library first converts a Markdown string to HTML (using Showdown) and then to PDF (using Chromium's built-in print functionality). This makes it possible to convert Markdown to PDF with a minimal number of dependencies in Electron apps.
1npm install electron-md-to-pdf
This module exposes two functions:
mdToPdfBuffer(md, options)
, which generates a PDF from the provided Markdown string (md
) and returns it as a Buffer
mdToPdfFile(md, filePath, options)
, which generates a PDF from the provided Markdown string and saves it at the provided filePath
Both functions return promises.
The options
parameter is optional. It's an object which may contain the following values:
basePath
(String): Base directory for relative paths of resources, e.g. images. Default: Current directorycssString
(String): CSS string to inject into the HTML which is generated from the Markdown string (e.g. "body { color: red; }"
)cssFiles
(String array): Array of CSS files to inject into the HTML (e.g. ["./path/to/styles.css"]
)mdFlavor
(String): Markdown flavor to use, one of ["original", "vanilla", "github"]
(see the Showdown docs). Default is "github"
pdfOptions
(Object): Options to pass to Electron's PDF print function (see the Electron docs)showdownOptions
(Object): Other options for the HTML generation (see the Showdown docs)wrapperClasses
(String): Class(es) to apply to the wrapper div
around the Markdown HTMLSee the examples on how to use the module in the main process and renderer process.
Make sure you have Node.js and Yarn installed.
git clone REPO_URL
yarn
yarn start
Suggestions and contributions are always welcome! Please first discuss changes via issue before submitting a pull request.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/28 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More