久久一区激情,国产在线久久久,成人看片网站,国产香蕉一区二区三区在线视频

win7系統下載
當前位置: 首頁 > 系統軟件教程 > 詳細頁面

PDF加密小工具-PDF加密小工具下載 v1.0官方版本

PDF加密小工具-PDF加密小工具下載 v1.0官方版本
  • 軟件類型:系統軟件
  • 軟件語言:簡體中文
  • 授權方式:免費軟件
  • 更新時間:2022-10-26
  • 閱讀次數:
  • 推薦星級:
  • 運行環境:WinXP,Win7,Win10,Win11
軟件介紹
分享到: 0

PDF加密小工具,由論壇用戶原創制作分享的一個PDF加密工具,可以設置密碼,將pdf文檔一鍵加密,可以分別設置瀏覽密碼和編輯密碼,給你的重要文檔設置雙重保護。本站提供PDF加密工具單文件程序下載,其中源碼數據如下,需要對PDF文件進行加密處理的朋友們可以下載試試。


PDF加密工具功能

設置pdf文檔加密和編輯密碼

自由設置文件路徑格式

源碼一覽

# -*- coding: utf-8 -*-

# ☯ Author: ChinaPython

# ☯ Date? : 2021/9/16 19:01

import os

import PySimpleGUI as sg

from PyPDF2 import PdfFileWriter

from PyPDF2 import PdfFileReader

class EncryptTool:

def __init__(self):

self.layout = [

[

sg.Text(text="閱覽密碼"),

sg.InputText(do_not_clear=True, default_text="默認:admin", text_color='gray', key='psw_a', size=(17, 1)),

sg.Text(text="編輯密碼"),

sg.InputText(do_not_clear=True, default_text="默認:admin", text_color='gray', key='psw_b', size=(17, 1)),

],

[

sg.Input(do_not_clear=True, default_text='選擇需要轉換的PDF文件(默認同路徑)', text_color='gray', key='path'),

sg.FileBrowse(button_text='選擇文件', key='file'),

],

[

sg.Input(do_not_clear=True, default_text='轉換后PDF文件存儲路徑', text_color='gray', key='path2'),

sg.FolderBrowse(button_text='輸出目錄', key='folder'),

],

[sg.Text(text="", size=(48, 4), background_color="white", text_color="red", key="msg")],

[sg.Button(button_text='開始加密', key='start', size=(48, 2))],

]

self.window = sg.Window('PDF加密小工具(吾愛破解論壇)', self.layout, icon='icon.ico')

@staticmethod

def __encrypt(unencrypted_pdf, read_password, encrypted_pdf=None, owner_password=None):

unencrypted_pdf = "加密_" + unencrypted_pdf if encrypted_pdf is None else unencrypted_pdf

owner_password = owner_password if owner_password is None else owner_password

try:

content = PdfFileReader(unencrypted_pdf)

writer = PdfFileWriter()

[writer.addPage(content.getPage(page)) for page in range(content.getNumPages())]

writer.encrypt(user_pwd=read_password, owner_pwd=owner_password, use_128bit=False)

with open(encrypted_pdf, 'wb') as out:

writer.write(out)

return os.path.exists(encrypted_pdf)

except Exception as e:

return e

# 運行入口

def run(self):

while True:

event, values = self.window.Read()

if event == 'start':

a, b, c, d = values['psw_a'], values['psw_b'], values['path'], values['path2']

if os.path.exists(c) is False or str(c).lower().endswith(".pdf") is False:

self.window.Element('msg').Update("加載目錄失敗,請檢測路徑的合法性")

continue

a = "admin" if "默認:" in a or len(a) == 0 else a

b = "admin" if "默認:" in b or len(b) == 0 else b

filepath, filename = os.path.split(c)

d = f"np3x1ik6bqol/加密_{filename}" if os.path.isdir(d) is True else f"{filepath}/加密_{filename}"

msg = self.__encrypt(c, a, d, b)

if msg is not True:

self.window.Element('msg').Update(f"加密失敗:{msg}")

continue

self.window.Element('msg').Update(

f"閱覽密碼:{a}\n編輯密碼:{b}\n目標文件:{c}\n輸出文件:np3x1ik6bqol"

)

if event is None:

break

self.window.close()

if __name__ == '__main__':

start = EncryptTool()

start.run()


系統軟件一般是在計算機系統購買時隨機攜帶的,也可以根據需要另行安裝。


點下面下載:(推薦使用"迅雷"進行下載,系統下載大全QQ交流群:)
主站蜘蛛池模板: 盐城市| 安岳县| 玉门市| 贵州省| 红安县| 民勤县| 辽中县| 关岭| 沧州市| 威海市| 九龙县| 台东县| 黎城县| 通化市| 车致| 台南县| 乡宁县| 麦盖提县| 阜康市| 吴川市| 两当县| 介休市| 崇左市| 砀山县| 舟曲县| 凯里市| 巴里| 德兴市| 台前县| 金沙县| 兴国县| 建瓯市| 黄浦区| 探索| 博白县| 涞源县| 台中市| 阿荣旗| 松滋市| 历史| 舞钢市|