Skip to content

Commit

Permalink
Add functions to encrypt PDFs for pdf version 1.3 (#2959)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Holländer <lukas.hollaender@yworks.com>
  • Loading branch information
owenl131 and HackbrettXXX committed Oct 28, 2020
1 parent d032321 commit c44b9c1
Show file tree
Hide file tree
Showing 25 changed files with 1,350 additions and 549 deletions.
21 changes: 21 additions & 0 deletions examples/js/annotations.js
@@ -0,0 +1,21 @@
var doc = new jsPDF({
unit: "px",
format: [200, 300],
floatPrecision: 2,
});

doc.textWithLink("Click me!", 10, 10, {
url: "https://parall.ax/",
});
doc.createAnnotation({
type: "text",
title: "note",
bounds: {
x: 10,
y: 10,
w: 200,
h: 80
},
contents: "This is text annotation (closed by default)",
open: false
});
4 changes: 3 additions & 1 deletion examples/js/editor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/js/password.js
@@ -0,0 +1,12 @@
var doc = new jsPDF({
encryption: {
userPassword: "user",
ownerPassword: "owner",
userPermissions: ["print", "modify", "copy", "annot-forms"]
// try changing the user permissions granted
}
});

doc.setFontSize(40);
doc.text("Octonyan loves jsPDF", 35, 25);
doc.addImage("examples/images/Octonyan.jpg", "JPEG", 15, 40, 180, 180);

0 comments on commit c44b9c1

Please sign in to comment.