diff --git a/scripts/word_to_pdf_converter/Test.docx b/scripts/word_to_pdf_converter/Test.docx new file mode 100644 index 0000000..b08cc44 Binary files /dev/null and b/scripts/word_to_pdf_converter/Test.docx differ diff --git a/scripts/word_to_pdf_converter/Test.pdf b/scripts/word_to_pdf_converter/Test.pdf new file mode 100644 index 0000000..f7ee69e Binary files /dev/null and b/scripts/word_to_pdf_converter/Test.pdf differ diff --git a/scripts/word_to_pdf_converter/requirements.txt b/scripts/word_to_pdf_converter/requirements.txt new file mode 100644 index 0000000..2405676 --- /dev/null +++ b/scripts/word_to_pdf_converter/requirements.txt @@ -0,0 +1 @@ +docx2pdf==0.1.8 \ No newline at end of file diff --git a/scripts/word_to_pdf_converter/script.py b/scripts/word_to_pdf_converter/script.py new file mode 100644 index 0000000..0026089 --- /dev/null +++ b/scripts/word_to_pdf_converter/script.py @@ -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()