I am using reportab to generate a pdf file.
The last sentences of my script are as follows:
doc.build(story)
os.system('xxxx.pdf') # show the pdf file.
Then leave the script and save the created pdf file where I like. But, I want to know how can I save the file without showing it.
doc.save('xxxx.pdf')
: *** AttributeError: 'SimpleDocTemplate' object has no attribute 'save'
What can I do to save the file automaticaly
The command
os.system('xxxx.pdf')
means that the PDF is already saved onto disk at 'xxxx.pdf'. Just remove the os.system command that launches your default PDF viewer, and you will see the PDF in the folder.