-
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 reuse the font if it is already embedded in the PDF.
- Loading branch information
Showing
11 changed files
with
303 additions
and
37 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 |
---|---|---|
|
@@ -51,9 +51,10 @@ Just import the dependencies and this tool. | |
<script src="https://unpkg.com/[email protected]/dist/forge.min.js" type="text/javascript"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/zgapdfsigner/dist/zgapdfsigner.min.js" type="text/javascript"></script> | ||
``` | ||
When drawing text by non-standard font, importing the fontkit library is necessary. | ||
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/[email protected]/dist/pako_inflate.min.js" type="text/javascript"></script> | ||
``` | ||
|
||
### [Google Apps Script](https://developers.google.com/apps-script) | ||
|
@@ -68,8 +69,10 @@ function setTimeout(func, sleep){ | |
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 by non-standard font. | ||
// It is necessary for drawing text for signature. | ||
eval(UrlFetchApp.fetch("https://unpkg.com/@pdf-lib/fontkit/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 | ||
eval(UrlFetchApp.fetch("https://unpkg.com/[email protected]/dist/forge.min.js").getContentText()); | ||
// Load ZgaPdfSigner | ||
|
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.