Giter Site home page Giter Site logo

gonultasbu / pdf_merge Goto Github PK

View Code? Open in Web Editor NEW
24.0 1.0 8.0 6.71 MB

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.

Python 100.00%
pdf-merge pdf-merger pdf merge-pdf merge merger

pdf_merge's Issues

PyPDF2.utils.PdfReadError: Could not find object.

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.

textDetection.pdf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.