I think this will be a problem with the pypdf library, not pdfshuffler itself.
FYI if you open the exported pdf in Adobe Reader instead of a poppler based program you get an error message "insufficient data for an image". I remember bugs in pdfedit that produced the same result, but I doubt that they would be directly related.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have encountered a very similar problem on Ubuntu 11.04.
When I import a PDF file produced by scanning, pdfshuffler is not able to export a PDF file -- when the Save button is clicked in the Export window the specified PDF file is not created and the following error is printed:
Traceback (most recent call last):
File "/usr/bin/pdfshuffler", line 411, in choose_export_pdf_name
self.export_to_file(file_out)
File "/usr/bin/pdfshuffler", line 432, in export_to_file
pdfdoc_inp = PdfFileReader(file(pdfdoc.copyname, 'rb'))
File "/usr/lib/pymodules/python2.7/pyPdf/pdf.py", line 277, in __init__
self.read(stream)
File "/usr/lib/pymodules/python2.7/pyPdf/pdf.py", line 651, in read
offset, generation = line[:16].split(" ")
ValueError: too many values to unpack
versions:
Linux 2.6.38-11-generic #47-Ubuntu SMP Fri Jul 15 19:27:09 UTC 2011 x86_64 GNU/Linux
pdfshuffler ver. 0.5-2
python-pypdf ver. 1.12-3
The source document. A PDF that contains only an image.
I think this will be a problem with the pypdf library, not pdfshuffler itself.
FYI if you open the exported pdf in Adobe Reader instead of a poppler based program you get an error message "insufficient data for an image". I remember bugs in pdfedit that produced the same result, but I doubt that they would be directly related.
I have encountered a very similar problem on Ubuntu 11.04.
When I import a PDF file produced by scanning, pdfshuffler is not able to export a PDF file -- when the Save button is clicked in the Export window the specified PDF file is not created and the following error is printed:
Traceback (most recent call last):
File "/usr/bin/pdfshuffler", line 411, in choose_export_pdf_name
self.export_to_file(file_out)
File "/usr/bin/pdfshuffler", line 432, in export_to_file
pdfdoc_inp = PdfFileReader(file(pdfdoc.copyname, 'rb'))
File "/usr/lib/pymodules/python2.7/pyPdf/pdf.py", line 277, in __init__
self.read(stream)
File "/usr/lib/pymodules/python2.7/pyPdf/pdf.py", line 651, in read
offset, generation = line[:16].split(" ")
ValueError: too many values to unpack
versions:
Linux 2.6.38-11-generic #47-Ubuntu SMP Fri Jul 15 19:27:09 UTC 2011 x86_64 GNU/Linux
pdfshuffler ver. 0.5-2
python-pypdf ver. 1.12-3
A test PDF file produced by Simple Scan 2.32.0.1 can be downloaded at
http://www.tempfiles.net/download/201108/206185/test4.html
-- rpr.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
This issue still exists in pdfshuffler 0.6.0 with python-pypdf 1.13-1 (tested on Ubuntu 12.04 64-bit).
-- rpr.
this bug is fixed in pypdf2
https://github.com/mstamy2/PyPDF2
now pdfshuffler supports pypdf2 as an alternative to pypdf, so I am closing this.
How to make pdfshuffler work with pypdf2? Latest Debian and Ubuntu do not have the pdfshuffler package that depends on python-pypdf2.
Last edit: rpr 2015-10-18