Skip to content

Commit c265d32

Browse files
authored
Upload hotfix 1.7.1
Correct erroneous password checks in save process to prevent PDF corruption.
1 parent 7944058 commit c265d32

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

save.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def save_pdf(fitz_doc, custom_metadata, page_points, compress_basic = False, com
4848
page.add_ink_annot(markings)
4949

5050

51-
if password != None:
51+
if password != None and password != "":
5252
perm = int( # Set the permissions for the file.
5353
fitz.PDF_PERM_ACCESSIBILITY
5454
| fitz.PDF_PERM_PRINT
@@ -63,5 +63,5 @@ def save_pdf(fitz_doc, custom_metadata, page_points, compress_basic = False, com
6363
fitz_doc.save(file_path, deflate = compress, garbage = garbage_num, encryption = fitz.PDF_ENCRYPT_AES_256, owner_pw=password, user_pw=password, permissions=perm) # Save the document (with encryption).
6464
else:
6565
fitz_doc.save(file_path, deflate = compress, garbage = garbage_num) # Save the document.
66-
66+
6767
return file_path

settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"version": "1.7",
2+
"version": "1.7.1",
33
"author": "lefkovitzj",
4-
"release_date": "2025-01-06",
4+
"release_date": "2025-03-02",
55
"newest_version_settings_url": "https://raw.githubusercontent.com/lefkovitzj/PyPdfApp/main/settings.json",
66
"newest_version_url": "https://github.com/lefkovitzj/PyPdfApp/",
77
"source_file_hashes": {
@@ -13,7 +13,7 @@
1313
"manipulate.py": "3a7b08abc613291a146d539df469a111",
1414
"merge.py": "045650cce3075d5417dec07950f5b44e",
1515
"pypdfgui.py": "8fdfcfe49f446369329f5987e90db221",
16-
"save.py": "ee0555227d8c7c0de6f027d99d72ac41",
16+
"save.py": "0a6852ceaec460d355cda1a7deacaf26",
1717
"sign.py": "c6568207bfae05c266780f6c35573a11",
1818
"utils.py": "a55616d8b31668ca840bc27da60593f7"
1919
},

0 commit comments

Comments
 (0)