Merge pull request #95 from Ayudh-65/master

Word to PDF converter
This commit is contained in:
Bartick Maiti 2022-10-03 22:00:30 +05:30 committed by GitHub
commit d507fb775b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,16 @@
# Word file (docx) to PDF converter
This is a easy-to-use Tkinter GUI application that takes a .docx file or a folder with .docx files as an input and converts them into .pdf files using the docx2pdf module
### Installing Requirements
- Open Windows Command Prompt
- Run command ``` pip install docx2pdf ```
### Usage
- Install the requirements (Python and docx2pdf module)
- Run the script
- Select the file/files to be converted
- Wait for confirmation
### Screenshots
![Screenshot](/scripts/word_to_pdf_converter/example_screenshot.jpg?raw=true)

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1 @@
docx2pdf==0.1.8

View File

@ -0,0 +1,32 @@
import tkinter as tk
from docx2pdf import convert
import tkinter.ttk as ttk
from tkinter.filedialog import askopenfile, askdirectory
from tkinter.messagebox import showinfo
win = tk.Tk()
win.title("Docx to PDF Converter")
def openfile():
file = askopenfile(filetypes=[("Word Files", "*.docx")])
convert(file.name)
showinfo("Done", "File Converted Successfully")
def openfolder():
folder = askdirectory()
convert(folder)
showinfo("Done", "Files Converted Successfully")
label = tk.Label(win, text="Select File/Folder to convert: ")
label.grid(row=0, column=0, padx=5, pady=5)
button1 = ttk.Button(win, text="Select File", width=30, command=openfile)
button1.grid(row=1, column=0, padx=5, pady=5)
button2 = ttk.Button(win, text="Select Folder", width=30, command=openfolder)
button2.grid(row=2, column=0, padx=5, pady=5)
win.mainloop()