gonultasbu / pdf_merge Goto Github PK
View Code? Open in Web Editor NEWI hated using online tools for merging my PDF files so I wrote a Python 3.6 script to merge all PDF files in a folder to a new PDF file.
I hated using online tools for merging my PDF files so I wrote a Python 3.6 script to merge all PDF files in a folder to a new PDF file.
On some PDF files the program gives the following error:
PdfReadWarning: Object 225 0 not defined. [pdf.py:1629]
Traceback (most recent call last):
File "/home/mert/Desktop/pdf_merge/pdf_merge.py", line 30, in <module>
merger.write(fout)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/merger.py", line 230, in write
self.output.write(fileobj)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 482, in write
self._sweepIndirectReferences(externalReferenceMap, self._root)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 571, in _sweepIndirectReferences
self._sweepIndirectReferences(externMap, realdata)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 547, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 571, in _sweepIndirectReferences
self._sweepIndirectReferences(externMap, realdata)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 547, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 556, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, data[i])
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 571, in _sweepIndirectReferences
self._sweepIndirectReferences(externMap, realdata)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 547, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 577, in _sweepIndirectReferences
newobj = data.pdf.getObject(data)
File "/home/mert/anaconda3/envs/pdf_merge/lib/python3.6/site-packages/PyPDF2/pdf.py", line 1631, in getObject
raise utils.PdfReadError("Could not find object.")
PyPDF2.utils.PdfReadError: Could not find object.
Process finished with exit code 1
Example PDF given in the attachment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.