Skip to content

Commit c44b9c1

Browse files
Add functions to encrypt PDFs for pdf version 1.3 (#2959)
Co-authored-by: Lukas Holländer <[email protected]>
1 parent d032321 commit c44b9c1

25 files changed

+1350
-549
lines changed

examples/js/annotations.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var doc = new jsPDF({
2+
unit: "px",
3+
format: [200, 300],
4+
floatPrecision: 2,
5+
});
6+
7+
doc.textWithLink("Click me!", 10, 10, {
8+
url: "https://parall.ax/",
9+
});
10+
doc.createAnnotation({
11+
type: "text",
12+
title: "note",
13+
bounds: {
14+
x: 10,
15+
y: 10,
16+
w: 200,
17+
h: 80
18+
},
19+
contents: "This is text annotation (closed by default)",
20+
open: false
21+
});

examples/js/editor.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/js/password.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var doc = new jsPDF({
2+
encryption: {
3+
userPassword: "user",
4+
ownerPassword: "owner",
5+
userPermissions: ["print", "modify", "copy", "annot-forms"]
6+
// try changing the user permissions granted
7+
}
8+
});
9+
10+
doc.setFontSize(40);
11+
doc.text("Octonyan loves jsPDF", 35, 25);
12+
doc.addImage("examples/images/Octonyan.jpg", "JPEG", 15, 40, 180, 180);

0 commit comments

Comments
 (0)