系列文章:
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
Just two clicks and you can convert a bunch of Doc and Docx files into PDF format.
最近遇到一個問題,想要把一堆的Word 轉成PDF。當然可以用手動的方式,一個個用Word打開,另存新檔,然後另存成PDF。可是這樣很麻煩,要是有100多個以上的Doc與Docx,然後要一一打開後再另存成PDF。有沒有更快的方法!!只要讓我點兩下滑鼠,不管有多少個Doc與Docx就能自動轉換成PDF?
I recently encountered a problem where I wanted to convert a bunch of Word files into PDFs. Of course, I could do it manually by opening each file in Word, saving it as a new file, and then saving it as a PDF. But that's very tedious, especially if there are more than 100 Doc and Docx files that need to be converted. Is there a faster way? Ideally, I would like to be able to convert all of the files to PDF with just two clicks of the mouse, regardless of how many Doc and Docx files there are.
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):
Download。Extraction Password: demo1234
使用教學(Instructional videos):
安裝pywin32套件(Install the pywin32 suite)
指令(command):pip install pywin32
指令(command):pip install pywin32
程式名稱(Program name):Word2Pdf.py
程式內容(Code):
# pip install pywin32
import glob
import os
from win32com import client
path=os.getcwd()
os.chdir(path+'\\input\\')
word = client.Dispatch("Word.Application")
for i in glob.glob('*.doc'):
print("Convert "+path+'\\input\\'+i+" to PDF!")
doc = word.Documents.Open(path+'\\input\\'+i)
doc.SaveAs("{}.pdf".format(path+'\\output\\'+i[:-4]),17)
print("{}.pdf".format(path+'\\output\\'+i[:-4])+" OK!")
doc.Close()
for i in glob.glob('*.docx'):
print("Convert "+path+'\\input\\'+i+" to PDF!")
docx = word.Documents.Open(path+'\\input\\'+i)
docx.SaveAs("{}.pdf".format(path+'\\output\\'+i[:-5]),17)
print("{}.pdf".format(path+'\\output\\'+i[:-5])+" OK!")
docx.Close()
word.Quit()
沒有留言:
張貼留言