-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved to support font subsetting and changed to use pdf-fontkit.
- Loading branch information
Showing
8 changed files
with
44 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,8 @@ signing with a timestamp from [TSA](https://github.com/zboris12/zgapdfsigner/wik | |
* [pdf-lib](https://pdf-lib.js.org/) | ||
* [node-forge](https://github.com/digitalbazaar/forge) | ||
* [follow-redirects](https://github.com/follow-redirects/follow-redirects) | ||
* [pako](https://github.com/nodeca/pako) - For drawing text | ||
* [pdf-fontkit](https://github.com/znacloud/pdf-fontkit) - For drawing text | ||
|
||
## How to use this tool | ||
|
||
|
@@ -53,9 +55,10 @@ Just import the dependencies and this tool. | |
``` | ||
When drawing text for signature, importing fontkit and pako library is necessary. | ||
```html | ||
<script src="https://unpkg.com/@pdf-lib/fontkit/dist/fontkit.umd.min.js" type="text/javascript"></script> | ||
<script src="https://unpkg.com/pdf-fontkit@1.8.9/dist/fontkit.umd.min.js" type="text/javascript"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/pako_inflate.min.js" type="text/javascript"></script> | ||
``` | ||
Thanks to [znacloud](https://github.com/znacloud/pdf-fontkit) for fixing the font subsetting issue in [@pdf-lib/fontkit](https://github.com/Hopding/fontkit). | ||
|
||
### [Google Apps Script](https://developers.google.com/apps-script) | ||
Load the dependencies and this tool. | ||
|
@@ -70,7 +73,7 @@ var window = globalThis; | |
// Load pdf-lib | ||
eval(UrlFetchApp.fetch("https://unpkg.com/[email protected]/dist/pdf-lib.min.js").getContentText()); | ||
// It is necessary for drawing text for signature. | ||
eval(UrlFetchApp.fetch("https://unpkg.com/@pdf-lib/fontkit/dist/fontkit.umd.min.js").getContentText()); | ||
eval(UrlFetchApp.fetch("https://unpkg.com/pdf-fontkit@1.8.9/dist/fontkit.umd.min.js").getContentText()); | ||
// Load pako, It is necessary for drawing text for signature. | ||
eval(UrlFetchApp.fetch("https://unpkg.com/[email protected]/dist/pako_inflate.min.js").getContentText()); | ||
// Load node-forge | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.