I am using PyPDF2 to merge multiple pdf files and then use python shutil method to copy the output to the final destination and use smtplib to email a copy(as an attachment) to a user.
The merged files in the final destination is appearing correctly but the emailed copy(attachment) is not. Only fist item in an array is appearing but rest page is blank with correct total number of pages.
Here is my workflow
I am using following code to merge files
pdf_list=['pdf_source.pdf','second_file.pdf','third_file.pdf']
for pdf in pdf_list:
merger.append(PdfFileReader(pdf),'rb')
with open(merge_file_name, 'wb') as new_file:
merger.write(new_file)
Please suggest
After researching, I found the issue was not pypdf2 but the way file was being attached to an email.
Following stackoverflow solution fixed the issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.