Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to encrypt PDFs for pdf version 1.3 #2959

Merged
merged 51 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
d0d7803
Add functions to encrypt pdfs for pdf version 1.3
owenl131 Oct 14, 2020
3aab47c
Undo formatting changes
owenl131 Oct 14, 2020
7f9994b
Run prettier
owenl131 Oct 14, 2020
86111a5
Handle encryption options when creating pdf
owenl131 Oct 15, 2020
a9666b9
Merge branch 'master' into master
owenl131 Oct 15, 2020
b4f2580
Add dist updates
owenl131 Oct 15, 2020
eb83014
Run prettier
owenl131 Oct 15, 2020
d8cf042
Update modules.conf
owenl131 Oct 15, 2020
3eb7000
Fix node tests
owenl131 Oct 15, 2020
1e44bf6
Stop using javascript class syntax
owenl131 Oct 15, 2020
d86d132
Remove lambdas
owenl131 Oct 15, 2020
7a7e1c7
Remove spread operator
owenl131 Oct 15, 2020
3ed62df
Merge branch 'master' into master
owenl131 Oct 15, 2020
3234457
Add example
owenl131 Oct 15, 2020
5606c3d
Merge branch 'master' of https://github.com/owenl131/jsPDF
owenl131 Oct 15, 2020
e85d096
Restore dist/ folder from upstream
owenl131 Oct 21, 2020
89ca254
Add license headers
owenl131 Oct 21, 2020
492f5ac
Add type annotations
owenl131 Oct 21, 2020
e083cbb
Add unit tests and reference pdfs
owenl131 Oct 21, 2020
68b9158
Make reset file work with encrypted file
owenl131 Oct 21, 2020
fae4efb
Fix typo
owenl131 Oct 21, 2020
199bd74
Change to IE compatible functions
owenl131 Oct 21, 2020
6663afc
Run prettier
owenl131 Oct 21, 2020
5acf3d5
Escape strings and encrypt strings in annotations module
owenl131 Oct 21, 2020
4bad3b0
Add example for annotations
owenl131 Oct 21, 2020
7cdf05d
Change reference pdf for closed annotation after pdfescaping the strings
owenl131 Oct 21, 2020
b63c324
Change reference pdf for open annotation after pdfescaping the strings
owenl131 Oct 21, 2020
1e45c88
Encrypt strings in acroforms modules
owenl131 Oct 22, 2020
f31288d
Allow default encryptor in test
owenl131 Oct 22, 2020
13b40a9
Fix problem with default appearance stream for textfields
owenl131 Oct 23, 2020
0a94bad
Add reference pdf for encryption with acroforms
owenl131 Oct 23, 2020
31cc347
Add writable to value
owenl131 Oct 23, 2020
ecbdef5
Fix error
owenl131 Oct 23, 2020
1e91e36
Fix typos of writable throughout code
owenl131 Oct 23, 2020
0cb9e42
Remove line setting subtype
owenl131 Oct 24, 2020
382ab43
Replace reference file
owenl131 Oct 24, 2020
6ee0037
Change float precision to 2 in test
owenl131 Oct 24, 2020
3e5a54b
Prompt rebuild
owenl131 Oct 24, 2020
dfb6c90
Merge branch 'master' into master
owenl131 Oct 26, 2020
0b650b7
Prompt rebuild
owenl131 Oct 26, 2020
9c39afd
getEncryptor should only be in the internal API
owenl131 Oct 26, 2020
cd61f7a
Add check for test environment
owenl131 Oct 26, 2020
f51c603
Add getEncryptor under API.internal in types
owenl131 Oct 26, 2020
cf9e168
Clean up after encryption tests
owenl131 Oct 26, 2020
ca9a864
Put guards around calls to scope.internal
owenl131 Oct 26, 2020
7599add
Remove global scope in acroform module
owenl131 Oct 27, 2020
d494636
Remove unnecessary scope assignments
owenl131 Oct 28, 2020
3a99d56
Remove console log
owenl131 Oct 28, 2020
f02c630
Refactor code
owenl131 Oct 28, 2020
f995b8c
Remove unnecessary statements
owenl131 Oct 28, 2020
748ebfb
Merge branch 'master' into master
HackbrettXXX Oct 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions examples/js/annotations.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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);
Loading