Python练手项目:PDF小工具-fitz版
python对办公一族来说,是个提高办公效率的得力利器。熟练使用它,可以轻松完成很多繁杂的事情。它可以轻松地操作Word、Excel、PDF这种文档。
今天需要整理一份资料,需要把多个pdf合并为一个,wps这些软件自然是有这个功能,但一般都是收费的,百度上也有很多网站,但资料上传到别人的网站,始终觉得还是不太可靠,故自己搜索了一下使用python来处理pdf文件,故此用tk制作了PDF小工具。
安装以下库:
python -m pip install -U pip
pip install PyMuPDF==1.19.0 -i https://pypi.mirrors.ustc.edu.cn/simple/
pdf_tool_fitz.py
源码如下:
#pip install PyMuPDF==1.19.0 -i https://pypi.mirrors.ustc.edu.cn/simple/
from pathlib import Path
import subprocess
import time
import sys
import tkinter as tk
from tkinter import ttk
import tkinter.filedialog as fd
import tkinter.messagebox as mb
import base64
import fitz
import threading
class PdfHandler:
page_count=None
page_index=None
img_path=None
def pdf_to_imgs(self,pdf_path,img_path,zoom_x,zoom_y,rotation_angle):
'''
pdf文件每页内容都转换成图片
:param pdf_path:pdf文件的路径
:param img_path:图像要保存的路径
:param zoom_x:x方向的缩放系数
:param zoom_y:y方向的缩放系数
zoom_x和zoom_y一般取相同值,值越大,图像分辨率越高
:param rotation_angle:旋转角度
:return:
'''
# 如果没有存储文件的目录,则创建
if not Path(img_path).exists():
Path(img_path).mkdir()
# 打开PDF文件
with fitz.open(pdf_path) as pdf:
self.page_count=pdf.page_count
# 逐页读取PDF
for page_index in range(0, pdf.pageCount):
self.page_index=page_index
page = pdf[page_index]
# 设置缩放和旋转系数,zoom_x, zoom_y取相同值,表示等比例缩放
trans = fitz.Matrix(zoom_x, zoom_y).prerotate(rotation_angle)
pm = page.getPixmap(matrix=trans, alpha=False)
self.img_path=f'{img_path}/{page_index}.png'
self.img_path=self.img_path.replace('/',"\\")
# 开始写图像
pm.writePNG(self.img_path) # 第1张图片名:0.png,以此类推
pm=None
def imgs_to_pdf(self,img_path, new_pdf_name):
'''
将图片转为pdf
:param imgPath: 图片路径
:param new_pdf_name: 多张图片合并成的pdf文件名
:return:
'''
with fitz.open() as doc: # 新建一个空文档
img_list=[]
for item in Path(img_path).iterdir():
img_list.append(item.name)
for page_index in range(len(img_list)):
self.page_index=self.page_index+1
img = fitz.open(f'{img_path}/{page_index}.png') # 打开图片
pdfbytes = img.convertToPDF() # 使用图片创建单页的 PDF
with fitz.open("pdf", pdfbytes) as imgpdf:
doc.insert_pdf(imgpdf)
img.close()
doc.save(new_pdf_name)
def imgs_2_pdf(self,old_pdf_names, new_pdf_name):
'''
将图片转为pdf
:param imgPath: 图片路径
:param new_pdf_name: 多张图片合并成的pdf文件名
:return:
'''
with fitz.open() as doc: # 新建一个空文档
for old_pdf_name in old_pdf_names:
img = fitz.open(old_pdf_name) # 打开图片
pdfbytes = img.convertToPDF() # 使用图片创建单页的 PDF
with fitz.open("pdf", pdfbytes) as imgpdf:
doc.insert_pdf(imgpdf)
img.close()
doc.save(new_pdf_name)
def img_invert_img(self,old_img_name, new_img_name):
'''
将图片转为pdf
:param imgPath: 图片路径
:param new_pdf_name: 多张图片合并成的pdf文件名
:return:
'''
with fitz.open() as doc: # 新建一个空文档
img = fitz.open(old_img_name) # 打开图片
pdfbytes = img.convertToPDF() # 使用图片创建单页的 PDF
with fitz.open("pdf", pdfbytes) as imgpdf:
doc.insert_pdf(imgpdf)
img.close()
img = doc.get_page_images(0)[0]
xref = img[0] #图片的xref编号,
base = img[1] #图片的基本名字,比如 'img0'
pix = fitz.Pixmap(doc, xref)
if pix.n < 5: # 这是一个灰度或者RGB图片
pix.invertIRect()
pix.writePNG(new_img_name)
else: # 这是一个CMYK图片
pix1 = fitz.Pixmap(fitz.csRGB, pix)
pix1.invertIRect()
pix1.writePNG(new_img_name)
pix1 = None
pix = None
'''
pm=doc[0].getPixmap(dpi=600,alpha=False)
pm.invertIRect()
pm.writePNG(new_img_name)
pm=None
'''
def merge_pdfs(self,old_pdf_names,new_pdf_name):
'''
从pdf文件合成为新的pdf文件
:param old_pdf_names: pdf文件名数组
:param new_pdf_name: 合并出的新pdf文件名
:return:
'''
print(old_pdf_names)
print(new_pdf_name)
file_writer = fitz.open()
for pdf in old_pdf_names:
file_reader = fitz.open(pdf)# 循环读取需要合并pdf文件
file_writer.insert_pdf(file_reader)
file_reader.close()
file_writer.save(new_pdf_name)
file_writer.close()
def split_pdf(self,old_pdf_name, new_pdf_name, from_page, to_page):
'''
从pdf文件中拆分出部分,拆出部分成为新的pdf文件
:param old_pdf_name: 原pdf文件名
:param new_pdf_name: 拆分后合并出的新pdf文件名
:param from_page: 原pdf文件起始页码索引(0开始,默认0)
:param to_page: 原pdf文件结尾页码索引(0开始,默认最后一页)
:return:
'''
with fitz.open(old_pdf_name) as old_pdf, fitz.open() as new_pdf:
new_pdf.insert_pdf(old_pdf, from_page, to_page)
new_pdf.save(new_pdf_name)
def get_pdf_text(self,pdf_path):
'''
获取每页pdf文件文本
:param pdf_path: pdf文件路径
:return:
'''
# 打开pdf文件,并新建html文件
with fitz.open(pdf_path) as pdf:
# 遍历每一页pdf,并显示进度条
for page in pdf:
text = page.get_text() #提取文本,传入参数'html'即:page.get_text('html') 则提取每页内容为html
print(f'第{page+1}页解析内容:\n{text}')
def get_pdf_images(self,img_path,pdf_path):
'''
获取每页pdf文件所有图片
:param pdf_path: pdf文件路径
:return:
'''
# 如果没有存储文件的目录,则创建
if not Path(img_path).exists():
Path(img_path).mkdir()
doc = fitz.open(pdf_path)
self.page_count=doc.page_count
page_index=0
for i in range(len(doc)):
self.page_index=i
for img in doc.get_page_images(i):
xref = img[0] #图片的xref编号,
#base = img[1] #图片的基本名字,比如 'img0'
pix = fitz.Pixmap(doc, xref)
self.img_path=f"{img_path}/{page_index}.png"
if pix.n < 5: # 这是一个灰度或者RGB图片
pix.writePNG(self.img_path)
else: # 这是一个CMYK图片
pix1 = fitz.Pixmap(fitz.csRGB, pix)
pix1.writePNG(self.img_path)
pix1 = None
pix = None # 让图片像素图清除内存
page_index+=1
doc.close()
# 防止字符串乱码
# os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'
data=[]
id=0
mydir='D:/'
kind='PDF'
PdfHandler=PdfHandler()
def thread_it(func,args):
'''将函数打包进线程'''
# 创建
t = threading.Thread(target=func, args=args)
# 守护 !!!
t.setDaemon(True)
# 启动
t.start()
# 阻塞--卡死界面!
# t.join()
def base64_to_image(base64_string, image_path):
base64_data = base64_string.encode("utf-8")
image_data = base64.b64decode(base64_data)
with open(image_path, "wb") as image_file:
image_file.write(image_data)
base64_string = '''
AAABAAcAEBAAAAAAIADNAQAAdgAAABgYAAAAACAALQMAAEMCAAAgIAAAAAAgAFMEAABwBQAAMDAAAAAAIAAzBwAAwwkAAEBAAAAAACAAPwoAAPYQAACAgAAAAAAgAB4WAAA1GwAAAAAAAAAAIAAYIwAAUzEAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAZRJREFUeJyNk0FKK0EQhv+ZnhndiotZeAjXQWNwHbyGF/AmBsxOiDgR3YsushG8gAcQVCTwIu7kacykPhfVGgkRbSiYqvr+7uqpahWFkedGCIZkNJtG78i4vTf+T9xu7z3WbDoTgmuKwlCWgQRFAfv78Drmx/U6dqYoXJNloDyHpSUYDCJl8FRDz2APt16MYY4MBq7Jc5AEnU4Uj+EEWAM0Z2t4jlhhp+NVqNGA2oAaTm0myObsM34a2dqg0QBVfd/xqYZVIAHCggpCzK1GFqDqgx6G7hza7OR58feqFFmAhyGkZSlJ0k0iJfp9JZGVpLKU0s8EfxAvYtPRyD/W+dsmRFaSRiMpvb5yZ8ekFUlTSWGBMMTcSmQl6fpK0uYGTGNr+vzexn4ctvcJbG3FQTrozgbpCCgXdKDEc7z5gVXlg5RkGeSZdHEptVp+yX8mnaezv72O1Dap/Ha34VDa3ZW+HtPyMnS7MK5/fkzvUzg7g+dn9ycT/DWGAEniG7VacFzB3SO81W53jx7b3nam3YaXFzCDD2tbU1K76U/cAAAAAElFTkSuQmCCiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAAD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4frycTG9C95zYy+eDL7+UhWJeew127jQdkf1FQAtACHJz4fLLZULI+efXXVtNmXPkCPz73zBzJsyfDwcPmo6oLptvB7QAhCE1FYYMkcc+l10G+fmmI0pMX38N77wDr74KS5faPaajVy+5ErCtCGgBiFCXLnDFFXDttXDuubLOmoqesjKZk//WWzBvnrn7+3DYWAS0ADgkLU0KwNVXy0SSwkK5UlCRq6qS5/cLFsDcufD55+6d2GVbEdACEAU5OTB4sNweDBsGPXpIgVDBq6qSadwffCDrOyxbBocOmY7KGb16yW2LDR2DWgCiLDdXrgyKiuCii+Tk5+SYjspOpaUyrn7JEnjvPfmkt61Dzym2FAEtADGUmQk9e8oThIsugn79pAMxUa8OKivhm29kGu6SJdKTv3699OonAhuKgBYAg9q2lSQYNAgGDpSv8/IgK8t0ZNFx5Ig0+LVrZQLO8uXydSLv92h6nIAWAIu0bg0FBdJBdNZZUhC6doVWrdy38UlZGezbJwtrfPWVTJBZvRq2bJHvq+NMXgl4hg3z+xcvjv0bq6Z5PFIU8vKkI7GgQD4x2reX0YmnnQbp6XLFkJR0/N9EU+1iGTU1sl17RYXcp+/cKZNs1q+HrVtlTb1vvoG9e3X7tmCcfroMXe7fP7bv6xk3zu//5JPoJ44Kjd8vL59PGlvt2nTJydLgc3OhZUspDnl58nWLFtChg4xFSEuTPofar73e47/z5Abp98vf1w5x9njkPY8elUZeXi698qWlsHs3HDggr2++kdf+/VIEystleq3fLwUpKUl+p8ej+dWU6mq5Anj66djORP3/x0nwPLqTItMAAAAASUVORK5CYII=
'''
image_path = "pdf_tool_ico.ico" # 解码后的图像文件保存路径
if Path(image_path).exists():
#获得文件创建时间
creation_time = time.gmtime(Path(image_path).stat().st_mtime+28800)
creation_time_str=time.strftime("%Y-%m-%d %H:%M:%S",creation_time)
#print(creation_time_str)
#获得当前时间
current_time = time.localtime()
current_time_str=time.strftime("%Y-%m-%d %H:%M:%S",current_time)
#print(current_time_str)
# 比较年、月、日是否相同
is_same_day = creation_time_str[:10]== current_time_str[:10]
# 输出结果
if is_same_day:
#print("时间处于同一天")
sys.exit()
else:
#print("时间不处于同一天")
Path(image_path).unlink()
base64_to_image(base64_string, image_path)
def invert_color():
try:
ssid=tv.selection()[0]
except:
mb.showinfo('警告!', '请从PDF合并表中选择一个文件!')
return
img_path=tv.item(ssid)['values'][2]
fwr=en_path.get()+'/'+en_file.get()+'.png'
if Path(fwr).exists():
fwr=show_dialog(fwr)
if fwr==None:
return
else:
PdfHandler.img_invert_img(img_path,fwr)
else:
PdfHandler.img_invert_img(img_path,fwr)
print('图片反色成功')
fwr=fwr.replace('/',"\\")
if(mb.askyesno(title='PDF合成成功',message='是否打开文件:%s'%fwr)):
subprocess.run(f'start "" "{fwr}"',shell=True,close_fds=True)
def pdf_compose(fres,fwr):
PdfHandler.merge_pdfs(fres,fwr)
def img_compose(fres,fwr):
PdfHandler.imgs_2_pdf(fres,fwr)
def pdf_dismantle(fre,fwr,spage,epage):
PdfHandler.split_pdf(fre,fwr,from_page=spage, to_page=epage-spage-1)
def center_window(root,w, h):
ws = root.winfo_screenwidth()
hs = root.winfo_screenheight()
x = (ws/2) - (w/2)
y = (hs/2) - (h/2)
root.geometry('%dx%d+%d+%d' % (w, h, x, y))
def delete():
try:
ssid=tv.selection()[0]
except:
return
sid=int(ssid)
tv.delete(sid)
del data[:]
sim=tv.get_children()
#print(sim)
for i in sim:
ins=tv.item(i)['values']
data.append(ins)
tv.delete(i)
#print(data)
global id
id=0
for ins in data:
id+=1
ins[0]=id
tv.insert('','end',iid=id,values=ins)
def insert():
global mydir,kind,id
if kind=='PDF':
pdf_paths = fd.askopenfilenames(title='选择文件',initialdir = mydir,filetypes=[("PDF file", "*.pdf")])
for pdf_path in pdf_paths:
print(pdf_path)
if(pdf_path==''):
return
id+=1
pdf_file=pdf_path.split ('/')[-1].split ('.pdf')[0]
pdf = fitz.open(pdf_path)
pdf_pages=pdf.page_count
pdf.close()
pdf=None
mydir=pdf_path.rsplit('/',1)[0]+'/'
ins=(id,pdf_file,pdf_path,pdf_pages)
tv.insert('','end',iid=id,values=ins)
else:
img_paths = fd.askopenfilenames(title='选择文件',initialdir =mydir,filetypes=[("JPEG file", "*.jpeg;*.jpg"),("PNG file", "*.png"),("GIF file","*.gif"),("BMP file","*.bmp")])
for img_path in img_paths:
print(img_path)
if(img_path==''):
return
id+=1
img_file=img_path.split ('/')[-1].split ('.pdf')[0]
img_pages='1'
mydir=img_path.rsplit('/',1)[0]+'/'
ins=(id,img_file,img_path,img_pages)
tv.insert('','end',iid=id,values=ins)
def correct():
try:
sid=tv.selection()[0]
except:
return
global mydir
if kind=='PDF':
pdf_path = fd.askopenfilename(title='选择文件',initialdir = mydir,filetypes=[("PDF file", "*.pdf")])
with fitz.open(pdf_path) as pdf:
pdf_pages=pdf.page_count
else:
pdf_path = fd.askopenfilename(title='选择文件',initialdir =mydir,filetypes=[("JPEG file", "*.jpeg;*.jpg"),("PNG file", "*.png"),("GIF file","*.gif"),("BMP file","*.bmp")])
pdf_pages='1'
if(pdf_path==''):
return
pdf_file=pdf_path.split ('/')[-1].split ('.pdf')[0]
mydir=pdf_path.rsplit('/',1)[0]+'/'
tv.set(sid,column='file', value=pdf_file)
tv.set(sid,column='path', value=pdf_path)
tv.set(sid,column='pages', value=pdf_pages)
def compose():
global kind
if kind=='PDF':
sim=tv.get_children()
if(len(sim)<2):
mb.showinfo('警告!', 'PDF合并表需要添加二个以上文件才能合并!')
return
del data[:]
for i in sim:
data.append(tv.item(i)['values'])
fres=[]
for i in data:
fres.append(i[2])
fwr=en_path.get()+'/'+en_file.get()+'.pdf'
if fwr in fres:
mb.showinfo('警告!', '输出文件名跟PDF合并表中的一个文件同名!')
return
if Path(fwr).exists():
fwr=show_dialog(fwr)
if fwr==None:
return
else:
pdf_compose(fres,fwr)
else:
pdf_compose(fres,fwr)
print('PDF合成成功')
fwr=fwr.replace('/',"\\")
if(mb.askyesno(title='PDF合成成功',message='是否打开文件:%s'%fwr)):
subprocess.run(f'start "" "{fwr}"',shell=True,close_fds=True)
else:
sim=tv.get_children()
if(len(sim)<1):
mb.showinfo('警告!', 'PDF合并表需要添加一个以上文件才能合并!')
return
del data[:]
for i in sim:
data.append(tv.item(i)['values'])
fres=[]
for i in data:
fres.append(i[2])
fwr=en_path.get()+'/'+en_file.get()+'.pdf'
if Path(fwr).exists():
fwr=show_dialog(fwr)
if fwr==None:
return
else:
img_compose(fres,fwr)
else:
img_compose(fres,fwr)
print('PDF合成成功')
fwr=fwr.replace('/',"\\")
if(mb.askyesno(title='PDF合成成功',message='是否打开文件:%s'%fwr)):
subprocess.run(f'start "" "{fwr}"',shell=True,close_fds=True)
def openFloder():
folder_path = fd.askdirectory(initialdir = 'D:/') # 打开文件
if(folder_path==''):
return
folder_path = folder_path[:-1] if folder_path[-1]=='/' else folder_path
en_path.config(state='normal')
en_path.delete(0,'end') # 清空
en_path.insert(0,folder_path) #写入路径
en_path.config(state='disabled')
def dismantle():
try:
ssid=tv.selection()[0]
except:
mb.showinfo('警告!', '请从PDF合并表中选择一个文件!')
return
if(tv.item(ssid)['values'][3]<2):
mb.showinfo('警告!', 'PDF只有一页!无需拆分!')
return
a=en_page.get()
b='-'
c=tv.item(ssid)['values'][3]
#print(a.split(b)[0])
#print(a.split(b)[1])
if(a.count(b)>1 or a.count(b)<1 or a[0].count(b)==1 or a[-1].count(b)==1 or int(a.split(b)[0])>=int(a.split(b)[1]) or int(a.split(b)[1])>int(c)):
mb.showinfo('警告!', '页码输入错误')
return
fre=tv.item(ssid)['values'][2]
spage=int(a.split(b)[0])
epage=int(a.split(b)[1])
fwr=en_path.get()+'/'+en_file.get()+'.pdf'
if fwr == fre:
mb.showinfo('警告!', '输出文件名跟PDF合并表中选择的文件同名!')
return
if Path(fwr).exists():
fwr=show_dialog(fwr)
if fwr==None:
return
else:
pdf_dismantle(fre,fwr,spage,epage)
else:
pdf_dismantle(fre,fwr,spage,epage)
print('PDF拆分成功')
fwr=fwr.replace('/',"\\")
if(mb.askyesno(title='PDF拆分成功',message='是否打开文件:%s'%fwr)):
subprocess.run(f'start "" "{fwr}"',shell=True,close_fds=True)
def pdf_imagepdf():
try:
ssid=tv.selection()[0]
except:
mb.showinfo('警告!', '请从PDF合并表中选择一个文件!')
return
fre=tv.item(ssid)['values'][2]
fwr=en_path.get()+'/'+en_file.get()+'.pdf'
print(Path.cwd())
img_path=f"{Path.cwd()}/img_path"
if fwr == fre:
mb.showinfo('警告!', '输出文件名跟PDF合并表中选择的文件同名!')
return
if Path(fwr).exists():
fwr=show_dialog(fwr)
if fwr==None:
return
else:
thread_it(p_i_p,(fre,img_path,fwr))
thread_it(progressbar_show,(fwr,2))
else:
thread_it(p_i_p,(fre,img_path,fwr))
thread_it(progressbar_show,(fwr,2))
def p_i_p(fre,img_path,fwr):
PdfHandler.pdf_to_imgs(fre,img_path,2,2,0)
PdfHandler.imgs_to_pdf(img_path,fwr)
print('转纯图PDF成功')
time.sleep(0.5)
fwr=fwr.replace('/',"\\")
if(mb.askyesno(title='转纯图PDF成功',message='是否打开文件:%s'%fwr)):
subprocess.run(f'start "" "{fwr}"',shell=True,close_fds=True)
for path in Path(img_path).iterdir():
Path(path).unlink()#删除文件
Path(img_path).rmdir()#删除文件夹
def progressbar_show(fwr=None,num=1):
scrolling.deiconify()
scrolling.attributes("-topmost",True)#窗口置顶
root.attributes('-disabled',True)#父窗口操作锁定
while True:
page_count=PdfHandler.page_count
page_index=PdfHandler.page_index
if(page_count!=None):
progressbar['value'] = (page_index/(num*page_count))*100
if(page_count<=page_index+1):
scrolling_label['text'] = f'正在生成:{fwr}'
else:
scrolling_label['text'] = f'正在生成:{PdfHandler.img_path}'
# 更新画面
root.update()
time.sleep(0.05)
if(num*page_count==page_index+1):
break
else:
time.sleep(0.1)
print('滚动条结束')
PdfHandler.page_count=None
PdfHandler.page_index=None
PdfHandler.img_path=None
scrolling.withdraw()
scrolling.attributes("-topmost",False)
root.attributes('-disabled',False)
progressbar['value'] =0
def run_pdf_imgs():
try:
ssid=tv.selection()[0]
except:
mb.showinfo('警告!', '请从PDF合并表中选择一个文件!')
return
# 创建线程并启动
thread1 = threading.Thread(target=pdf_imgs)
thread1.start()
thread2 = threading.Thread(target=progressbar_show)
thread2.start()
def run_get_pdf_imgs():
try:
ssid=tv.selection()[0]
except:
mb.showinfo('警告!', '请从PDF合并表中选择一个文件!')
return
# 创建线程并启动
thread1 = threading.Thread(target=get_pdf_imgs)
thread1.start()
thread2 = threading.Thread(target=progressbar_show)
thread2.start()
def pdf_imgs():
try:
ssid=tv.selection()[0]
except:
mb.showinfo('警告!', '请从PDF合并表中选择一个文件!')
return
pdf_path=tv.item(ssid)['values'][2]
img_path=en_path.get()+'/'+en_file.get()
PdfHandler.pdf_to_imgs(pdf_path,img_path,2,2,0)
print('PDF转图片成功')
time.sleep(0.5)
img_path=img_path.replace('/',"\\")
if(mb.askyesno(title='PDF转图片成功',message='是否打开文件夹:%s'%img_path)):
subprocess.run(["explorer.exe",img_path])
def get_pdf_imgs():
try:
ssid=tv.selection()[0]
except:
mb.showinfo('警告!', '请从PDF合并表中选择一个文件!')
return
pdf_path=tv.item(ssid)['values'][2]
img_path=en_path.get()+'/'+en_file.get()
PdfHandler.get_pdf_images(img_path,pdf_path)
print('PDF提取图片成功')
time.sleep(0.5)
img_path=img_path.replace('/',"\\")
if(mb.askyesno(title='PDF提取图片成功',message='是否打开文件夹:%s'%img_path)):
subprocess.run(["explorer.exe",img_path])
root = tk.Tk()
root.title('强联-PDF小工具 QQ群号:202013774')
root.iconbitmap(r'pdf_tool_ico.ico')
center_window(root,530,276)
root.resizable(width=False, height=False)
style = ttk.Style()
style.configure('TButton',foreground='black')
mystyle = ttk.Style()
mystyle.configure('my.TButton',foreground='red')
ttk.Label(root,text='PDF合并表').grid(column=0,row=0,columnspan=4)
area=('id','文件','路径','页数')
ac=('id','file','path','pages')
tv=ttk.Treeview(root,columns=ac,show='headings',height=5)
for i in range(4):
tv.column(ac[i],width=35,anchor='e')
tv.heading(ac[i],text=area[i])
tv.column(ac[1],width=140)
tv.column(ac[2],width=315)
tv.grid(column=0,row=1,columnspan=4)
ttk.Button(root,text='删除',command=delete).grid(column=0,row=2)
ttk.Button(root,text='添加',command=insert).grid(column=1,row=2)
ttk.Button(root,text='修改',command=correct).grid(column=2,row=2)
ttk.Button(root,text='PDF合并',command=compose).grid(column=3,row=2)
ttk.Button(root,text='输出目录',command=openFloder).grid(column=0,row=3)
en_path=ttk.Entry(root,text='默认输出目录',width=40)
en_path.grid(column=1,row=3,columnspan=2,sticky='W')
en_path.config(state='normal')
folder_path = str(Path.cwd())
print(folder_path)
folder_path = folder_path[:-1] if folder_path[-1]=='\\' else folder_path
en_path.insert(0,folder_path)
en_path.config(state='disabled')
en_page=ttk.Entry(root,text='默认输出页码',width=5,style='my.TButton',justify='center')
en_page.grid(column=3,row=3)
folder_page='0-1'
en_page.insert(0,folder_page)
ttk.Label(root,text='输出文件名').grid(column=0,row=4)
en_file=ttk.Entry(root,text='默认输出文件名',width=40)
en_file.grid(column=1,row=4,columnspan=2,sticky='W')
folder_file='合并'
en_file.insert(0,folder_file)
dis_button=ttk.Button(root,text='PDF拆分',style='my.TButton',command=dismantle)
dis_button.grid(column=3,row=4)
ttk.Label(root,text='-------小工具-------------------------------------------------------------------------------------------').grid(column=0,row=5,columnspan=4)
def on_selection_change(event):
global id,kind
kind=combo.get()
print("选中的值:", kind)
del data[:]
sim=tv.get_children()
#print(sim)
for i in sim:
ins=tv.item(i)['values']
data.append(ins)
tv.delete(i)
id=0
if kind=='PDF':
en_page.config(state='normal')
fi_button.grid_forget()
gpi_button.grid(column=1,row=6)
dis_button.config(state='normal')
pi_button.config(state='normal')
pip_button.config(state='normal')
else:
en_page.config(state='disabled')
gpi_button.grid_forget()
fi_button.grid(column=1,row=6)
dis_button.config(state='disabled')
pi_button.config(state='disabled')
pip_button.config(state='disabled')
# 创建下拉单选框
combo = ttk.Combobox(root, width=12)
combo.grid(column=0,row=6)
combo["values"] = ("PDF", "图片转PDF")
combo.current(0) # 设置默认选中第一个选项
combo.bind("<<ComboboxSelected>>", on_selection_change)
gpi_button=ttk.Button(root,text='PDF提取图片',command=run_get_pdf_imgs)
gpi_button.grid(column=1,row=6)
fi_button=ttk.Button(root,text='图片反色',command=invert_color)
fi_button.grid(column=1,row=6)
fi_button.grid_forget()
pi_button=ttk.Button(root,text='PDF转图片',command=run_pdf_imgs)
pi_button.grid(column=2,row=6)
pip_button=ttk.Button(root,text='转纯图PDF',command=pdf_imagepdf)
pip_button.grid(column=3,row=6)
def show_dialog(fwr):
sfwr=fwr.rsplit('/',1)
re_fwr = None
dialog=tk.Toplevel(root)
dialog.title('当前位置存在同名文件')
dialog.iconbitmap(r'pdf_tool_ico.ico')
dialog.transient(root)
#dialog.resizable(width=False, height=False)
#dialog.attributes("-toolwindow",True)
center_window(dialog,350,100)
def get_choose(num):
nonlocal re_fwr
if num==1:
re_fwr=fwr
elif num==2:
re_fwr=sfwr[0]+'/'+sfwr[1][:-4]+'_副本_'+sfwr[1][-4:]
else:
re_fwr=None
dialog.destroy()
ttk.Label(dialog, text=f'是否替换“{sfwr[1]}”?',font=("微软雅黑", 15)).grid(row=0,column=0,columnspan=3,sticky=tk.W)
ttk.Button(dialog,text='替换文件',command=lambda: get_choose(1)).grid(column=0,row=1,sticky=tk.E)
ttk.Button(dialog,text='创建副本',command=lambda: get_choose(2)).grid(column=1,row=1)
ttk.Button(dialog,text='取消',command=lambda: get_choose(None)).grid(column=2,row=1,sticky=tk.W)
dialog.rowconfigure(0,weight=3)
dialog.rowconfigure(1,weight=1)
dialog.columnconfigure(0,weight=3)
dialog.columnconfigure(1,weight=1)
dialog.columnconfigure(2,weight=1)
dialog.protocol("WM_DELETE_WINDOW",lambda: get_choose(None))
root.wait_window(dialog)
return re_fwr
scrolling=tk.Toplevel(root)
scrolling.overrideredirect(True)#去除标题栏
#scrolling.attributes("-topmost",True)
center_window(scrolling,350,50)
scrolling_label=ttk.Label(scrolling,font=("微软雅黑", 8),foreground='red')
scrolling_label.grid(row=0,column=0,sticky=tk.SW)
progressbar =ttk.Progressbar(scrolling,length=350)
progressbar.grid(row=1,column=0,sticky=tk.NW)
scrolling.rowconfigure(0,weight=1)
scrolling.rowconfigure(1,weight=1)
scrolling.withdraw()
def appQuit():
Path(r'pdf_tool_ico.ico').unlink()
root.destroy()
root.protocol("WM_DELETE_WINDOW", appQuit)
root.mainloop()
1.bat
@start "CMD窗口闭关" "pythonw" "pdf_tool_fitz.py" %1 %2 %3 %4 %5 %6 %7 %8 %9