Pyqt implements a collection of problems encountered in merging PDF

1. exit code -1073740791 error

pycharm encounters the following error:

“Process finished with exit code -1073740791 (0xC0000409)”

Just encountering this kind of problem, I don’t know where the problem is, and I’m a little confused

solution:

1. Click "Run" in the navigation bar and select "Edit Configurations"

2. Select "Emulate terminal in output console" and click "Apply" below and select "OK"

3. Run again to see the result

 

2. merge = PyPDF2.PdfFileMerger() reports an error

During the pdf merge operation, an error occurs when using PdfFileMerger. For this problem, you can observe the original function of the PyPDF2 3.0.0. file in detail. This method has been deleted, and the corresponding PdfMerger can be used instead.

solution:

Use the PdfMerger() method instead of the PdfFileMerger() method

 

3. Merge.append(PyPDF2.PdfFileReader(file)) reports an error

During the pdf merge operation, an error occurs when using PdfFileReader. For this problem, you can observe the original function of the PyPDF2 3.0.0. file in detail. This method has been deleted, and the corresponding PdfReader can be used instead.

solution:

Use the PdfReader() method instead of the PdfFileReader() method

 

        merge = PyPDF2.PdfMerger()
        for file in file_list:
            merge.append(PyPDF2.PdfReader(file))
        merge.write(pdf_tar_dir + '/sum.pdf')

Guess you like

Origin blog.csdn.net/yyfloveqcw/article/details/130264650