pdf空白頁刪除程式,網上pdf軟體刪除有些需要許可權、會員等亂七八糟的,然後通過查詢使用python實現了pdf空白頁或者指定頁刪除程式。
可執行程式:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#author:singweek
#time:2020/4/20 16:17
from pypdf2 import pdffilereader, pdffilewriter
# path = "f:\game\zx.pdf"
while true:
try:
path=input("請輸入待處理檔案路徑:")
auto=input("請輸入a自動刪除或者m手動刪除:")
reader = pdffilereader(open(path, 'rb'))
writer = pdffilewriter()
pages = reader.getnumpages()
path_output = ".\output.pdf"
if auto.upper()=="a":
for i in range(pages):
page = reader.getpage(i)
if "/xobject" in page["/resources"].keys() or "/font" in page["/resources"].keys():
writer.addpage(page)
else:
dealtmp=input("請輸入刪除頁數例如(4,12):")
deallist=
for i in dealtmp.split(","):
for i in range(pages):
page = reader.getpage(i)
if i+1 in deallist:
pass
else:
writer.addpage(page)
writer.write(open(path_output, 'wb'))
except:
print("輸入執行錯誤請檢測重新輸入!")
print("當前檔案處理完畢!")
out=input("輸入q退出:")
if out=='q':
break
linux下刪除程式
linux軟體的安裝和解除安裝一直是困擾許多新使用者的難題。在windows中,我們可以使用軟體自帶的安裝解除安裝程式或在控制面板中的 新增 刪除程式 來實現。與其相類似,在linux下有乙個功能強大的軟體安裝解除安裝工具,名為rpm。它可以用來建立 安裝 查詢 更新 解除安裝軟體。該工具是在命令列...
如何從「新增 刪除程式」列表中手動刪除程式
現在大家都在用office2007了,但是在公升級時發現了乙個問題,就是 word 2003 稿紙載入器解除安裝不掉,找不到安裝路徑,又不能安裝office2007,到網上找了 word 2003 稿紙載入器解除安裝程式,卻不能用。經過研究終於找到了方法,分享給大家,只要刪除 word 2003 稿...
執行後自刪除程式
當乙個可執行程式exe在執行過程中,程式檔案無法刪除,這是因為系統將每個正在執行的程式對應的硬碟檔案 對映到記憶體,即虛擬記憶體,要實現自刪除,關鍵一點在程式退出前將程式從記憶體對映中解放出來,然後 再呼叫檔案操作函式刪除程式檔案!typedef int winapi pfclose lpvoid ...