Jul-24-2021, 01:36 PM
(This post was last modified: Jul-24-2021, 02:40 PM by Yoriz.
Edit Reason: removed incorrect quote
)
I did use the dialog like this:
I found a solution that suits me. the pdf will open after it is created then the user can choose to save it.
saveFilePath = filedialog.asksaveasfile(mode='w', title="Save the file", defaultextension=".pdf", initialfile=pdf_file_name, filetypes=(("PDF Files", "*.pdf"),)) saveFilePath.close()and I am able to save as pdf but when trying to open it, it says it is not type of pdf. In the project directory the file is opening though. I think this will only have a default name of saving a file but not choosing the file that I want to save.
I found a solution that suits me. the pdf will open after it is created then the user can choose to save it.
subprocess.Popen([pdf_file_name], shell=True)