Gathering detailed insights and metrics for jspdf-customfonts
Gathering detailed insights and metrics for jspdf-customfonts
Gathering detailed insights and metrics for jspdf-customfonts
Gathering detailed insights and metrics for jspdf-customfonts
npm install jspdf-customfonts
Typescript
Module System
Node Version
NPM Version
55.4
Supply Chain
88.9
Quality
70.9
Maintenance
25
Vulnerability
95.6
License
JavaScript (100%)
Total Downloads
230,253
Last Day
42
Last Week
438
Last Month
3,067
Last Year
38,344
182 Stars
129 Commits
77 Forks
20 Watching
5 Branches
3 Contributors
Latest Version
0.0.4-rc.4
Package Id
jspdf-customfonts@0.0.4-rc.4
Unpacked Size
107.39 kB
Size
29.70 kB
File Count
6
NPM Version
5.8.0
Node Version
9.2.0
Cumulative downloads
Total Downloads
Last day
-72%
42
Compared to previous day
Last week
-46.7%
438
Compared to previous week
Last month
7.7%
3,067
Compared to previous month
Last year
27.6%
38,344
Compared to previous year
1
JsPDF is an open source that loads JavaScript in an HTML5 environment and creates a pdf document.
The current version does not support Custom Fonts. I will try to implement this feature.
It's on the GitHub Pages.
Version 0.0.4
I do not claim to be the author of the jsPDF library, this code simply adds preliminary custom fonts support.
0.0.1 Initial proof of concept
0.0.2 Support multiline text
0.0.3 Refactor multiline text
0.0.4 Make into a plugin
Download and include jspdf.customfonts.min.js.
You can also get the plugin with a package manager:
npm install jspdf-customfonts
This document will walk you through the basics of jsPDF and will show you how to create PDF files in the browser.
To begin with the default configuration, you should include 3 files:
npm install
node makeFonts.js
to create a new dist/default_vfs.js.1<!DOCTYPE html> 2<html> 3 4<head> 5 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 6 <title>jsPDF customfonts example</title> 7 <script src="https://unpkg.com/jspdf@latest/dist/jspdf.min.js"></script> 8 <script src="dist/jspdf.customfonts.min.js"></script> 9 <script src="dist/default_vfs.js"></script> 10</head> 11<body> 12...
1doc.addFileToVFS(fileName, Base64content);
1doc.addFont(fileName, fontName, fontStyle);
1var doc = new jsPDF(); 2 3doc.addFont('NotoSansCJKjp-Regular.ttf', 'NotoSansCJKjp', 'normal'); 4 5doc.setFont('NotoSansCJKjp'); 6doc.text(15, 30, 'こんにちは。はじめまして。'); 7 8//multi-lines Test 9var paragraph = '相次いで廃止された寝台列車に代わり、いまや夜間の移動手段として主力になりつつある夜行バス。「安い」「寝ながら移動できる」などのメリットを生かすため、運行ダイヤはどのように組まれているのでしょうか。夜遅く出て、朝早く着くというメリット夜行バスを使うメリットといえば、各種アンケートでもいちばん多い回答の「安い」以外に、'; 10var lines = doc.splitTextToSize(paragraph, 150); 11doc.text(15, 60, lines); 12 13doc.save('custom_fonts.pdf'); 14
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/27 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
65 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
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