系列文章:
1. 只要點兩下,就能將一堆的Doc與Docx 轉成 PDF
1.https://skjhcreator.blogspot.com/2023/05/docdocx-pdf.html
2.https://skjhcreator.blogspot.com/2023/06/jpgpdfjpgpdf.html
3.只要點兩下,就能將放進input的一堆PDF轉成各自的WORD
3.https://skjhcreator.blogspot.com/2023/10/inputpdfword.html
4.只要點兩下,就能將放進input的一堆PDF轉成在ouput資料夾內的各自的WORD
4.https://skjhcreator.blogspot.com/2023/10/inputpdfouputword.html
5.只要點兩下,就能夠將InputAndOutput資料夾底下的子子孫孫資料夾內所有Word通通轉成PDF
1.https://skjhcreator.blogspot.com/2023/05/docdocx-pdf.html
2.https://skjhcreator.blogspot.com/2023/06/jpgpdfjpgpdf.html
3.只要點兩下,就能將放進input的一堆PDF轉成各自的WORD
3.https://skjhcreator.blogspot.com/2023/10/inputpdfword.html
4.只要點兩下,就能將放進input的一堆PDF轉成在ouput資料夾內的各自的WORD
4.https://skjhcreator.blogspot.com/2023/10/inputpdfouputword.html
5.只要點兩下,就能夠將InputAndOutput資料夾底下的子子孫孫資料夾內所有Word通通轉成PDF
By simply double-clicking, you can convert a bunch of PDF files that are placed in the input folder into their respective Word documents, which will be located in the output folder.
根據上篇只要點兩下,就能將放進input的一堆PDF轉成各自的WORD,發現產出的WORD會跟執行程式PDFTOWORD.exe混在一起。當轉換的檔案多了,恐怕要用人工去一一核對,造成不便。如果產出的產出的WORD會集中在一個output資料夾,只要移動output資料即可。
According to the previous article, by simply double-clicking, you can convert a bunch of PDF files that are placed in the input folder into their respective Word documents. However, it was found that the generated Word documents are mixed with the execution program PDFTOWORD.exe. When there are multiple converted files, it might be inconvenient to manually check each one. To address this issue, if the generated Word documents are centralized in an output folder, you can simply move the output folder.
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234使用教學(Instructional videos):
以下是開發過程與原始碼 (Development process and code):
安裝pdf2docx套件(Install the pdf2docx suite)
指令(command):pip install pdf2docx
程式名稱(Program name):PdfToWord01.py
程式內容(Code):
#請安裝套件 pdf2docx
#指令 pip install pdf2docx
from pdf2docx import Converter
import os
#取得當前目錄
Path = os.getcwd()
#取得input路徑
InputPath = Path+'\\input\\'
#取得input資料夾下的目錄或檔案
dirs = os.listdir(InputPath)
#檢查目錄是否存在
if os.path.exists(Path+'\\output'):
#印出output資料夾存在
print(Path+'\\output'+' exists!')
else:
#建立output資料夾
os.makedirs(Path+'\\output')
if dirs != []:
for dir in dirs:
fileName,fileExt = dir.split('.')
if fileExt.lower() == 'pdf':
PdfCvWord = Converter(InputPath+dir)
PdfCvWord.convert(Path+'\\output\\'+fileName+'.docx')
PdfCvWord.close()
else:
print('Input is empty!!')
資料來源:
1.只要點兩下,就能將放進input的一堆PDF轉成各自的WORD
2.
1.只要點兩下,就能將放進input的一堆PDF轉成各自的WORD
2.
沒有留言:
張貼留言