Pdftk fails on PDF annotations added from Evince

Bug #774052 reported by sdaau
56
This bug affects 12 people
Affects Status Importance Assigned to Milestone
pdftk (Ubuntu)
Confirmed
Undecided
Johann Felix Soden

Bug Description

Binary package hint: pdftk

Hi all,

Not sure if this is an evince bug or pdftk ... The procedure I do is this:
* I build an example PDF file using pdflatex and pdfcomment (so with annotations already present)
* I open this example PDF in evince, and I add another annotation there
* I save a copy from evince of this example PDF with extra example (say, example2.pdf)
* When I try to dump_data of example2.pdf with pdftk, I get:

$ pdftk example2.pdf dump_data
Error: Unexpected Exception in open_reader()
Unhandled Java Exception:
java.lang.NullPointerException
   at gnu.gcj.runtime.NameFinder.lookup(libgcj.so.11)
   at java.lang.VMThrowable.getStackTrace(libgcj.so.11)
   at java.lang.Throwable.getStackTrace(libgcj.so.11)
   at java.lang.Throwable.stackTraceString(libgcj.so.11)
   at java.lang.Throwable.printStackTrace(libgcj.so.11)
   at java.lang.Throwable.printStackTrace(libgcj.so.11)

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: pdftk 1.44-1
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic i686
Architecture: i386
Date: Sat Apr 30 14:01:21 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha i386 (20110325)
ProcEnviron:
 LANGUAGE=en_DK:en
 PATH=(custom, no user)
 LANG=en_DK.UTF-8
 SHELL=/bin/bash
SourcePackage: pdftk
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
sdaau (sd-imi) wrote :
Revision history for this message
Johann Felix Soden (johfel) wrote :

Thank you for taking the time to report this bug.

I made a version of pdftk containing more debugging information - the stack trace should be more usable. You can find the ppa at https://launchpad.net/~johfel/+archive/pdftk . Please install additionally the libgcj11-dbg package. Thanks!

Changed in pdftk (Ubuntu):
assignee: nobody → Johann Felix Soden (johfel)
Revision history for this message
Thomas Quinot (quinot-a) wrote :

I am seeing the same problem. I have installed the debugging version of pdftk as instructed and libgcj11-dbg, and still get the same stack strace:

Error: Unexpected Exception in open_reader()
Unhandled Java Exception:
java.lang.NullPointerException
   at gnu.gcj.runtime.NameFinder.lookup(libgcj.so.11)
   at java.lang.Throwable.getStackTrace(libgcj.so.11)
   at java.lang.Throwable.stackTraceString(libgcj.so.11)
   at java.lang.Throwable.printStackTrace(libgcj.so.11)
   at java.lang.Throwable.printStackTrace(libgcj.so.11)

I can send you the original document and the offending, evince-edited version.

Revision history for this message
Johann Felix Soden (johfel) wrote :

Thanks, Thomas, for your report. Unfortunately, pdftk with included debug symbols seems to not
give better output in this case.

But the open_reader bug should have been already fixed in pdftk 1.44-5 (Natty has 1.44-1).
I made a backport from the current 1.44-6 version for Natty.
You can find it in my ppa: https://launchpad.net/~johfel/+archive/pdftk

It would be helpful, if you could test it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pdftk (Ubuntu):
status: New → Confirmed
Revision history for this message
erickfis (erickfis) wrote :

Affects me as well:

erickis@erickis-K45A:~/SPR/treinamento/acidentes$ pdftk test.pdf burst
Error: Unexpected Exception in open_reader()
Unhandled Java Exception:
java.lang.NullPointerException
   at gnu.gcj.runtime.NameFinder.lookup(libgcj.so.14)
   at java.lang.Throwable.getStackTrace(libgcj.so.14)
   at java.lang.Throwable.stackTraceString(libgcj.so.14)
   at java.lang.Throwable.printStackTrace(libgcj.so.14)
   at java.lang.Throwable.printStackTrace(libgcj.so.14)
erickis@erickis-K45A:~/SPR/treinamento/acidentes$

erickis@erickis-K45A:~/SPR/treinamento/acidentes$slsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.10
Release: 13.10
Codename: saucy
erickis@erickis-K45A:~/SPR/treinamento/acidentes$

Revision history for this message
Blackhawke (michael-vetl) wrote :

Well, this is interesting. The last comment on this bug is 2012, and the bug has been "confirmed" and all, but it's now 2014 and I'm having the same problem and am getting the exact same errors on 12.04 trying to cat two pdfs. One was created by USPS, the other was created by Google.

Do we have a fix for this yet?

Revision history for this message
Blackhawke (michael-vetl) wrote :

Oh ooops! I see I missed the time date stamps on a couple of comments: One from this year, and one from 2013. So I'll just politely raise my arm and say "me too!" :)

Revision history for this message
Mike Lerley (akfy-7tk2-nw2w) wrote :

*raises arm* Me three!

On 14.04. gs sees nothing wrong with the file. Using pdftk 2.01. Offending file can be found at http://www.hellerindustries.com/supplier-partnership-benefits.pdf

Revision history for this message
Mads Petersen (mads-h) wrote :

+1

pdftk 2.01

Linux daiquiri 3.13.0-34-generic #60-Ubuntu SMP Wed Aug 13 15:45:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ pdftk A=train1.pdf B=train2.pdf C=train3.pdf cat A B C output travel.pdf
Error: Unexpected Exception in open_reader()
Unhandled Java Exception:
java.lang.NullPointerException
   at gnu.gcj.runtime.NameFinder.lookup(libgcj.so.14)
   at java.lang.Throwable.getStackTrace(libgcj.so.14)
   at java.lang.Throwable.stackTraceString(libgcj.so.14)
   at java.lang.Throwable.printStackTrace(libgcj.so.14)
   at java.lang.Throwable.printStackTrace(libgcj.so.14)
$

Revision history for this message
cxp (cxp) wrote :

Same here on Xubuntu 14.04.

3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
pdftk 2.01

I tested failed pdf files and recognized, they created by iText (by lowagie.com).

> Producer: iText 1.4.8 (by lowagie.com)
> Pages: 2
> Encrypted: yes (print:yes copy:no change:no addNotes:no algorithm:RC4)
> Page size: 595 x 842 pts (A4)
> File size: 30845 bytes
> Optimized: no
> PDF version: 1.4

Splitting the file with pdfshuffler 0.6.0 worked.

> Producer: Python PDF Library - http://pybrary.net/pyPdf/
> Pages: 1
> Encrypted: no
> Page size: 595 x 842 pts (A4)
> File size: 28274 bytes
> Optimized: no
> PDF version: 1.3

Then using pdftk again on new file worked too.

> Creator: pdftk 2.01 - www.pdftk.com
> Producer: Python PDF Library - http://pybrary.net/pyPdf/
> Pages: 1
> Encrypted: no
> Page size: 595 x 842 pts (A4)
> File size: 28486 bytes
> Optimized: no
> PDF version: 1.4

So, has it something to do with the encryption or with the library which created the original pdf file ?

Revision history for this message
gwern (gwern0) wrote :

This 'lowagie' bug seems to still be active. On my Ubuntu system, the 1971 Simon PDF "Designing Organizations for an Information-Rich World" https://veryinteractive.net/pdfs/simon_designing-organizations-for-an-information-rich-world.pdf (MD5: `1c7cceee6de48ba3ab80db269295e136`) crashes any pdftk invocation as follows:

$ pdftk 1971-simon.pdf cat output foo.pdf
Error: Unexpected Exception in open_reader()
java.lang.ClassCastException: class pdftk.com.lowagie.text.pdf.PdfNull cannot be cast to class pdftk.com.lowagie.text.pdf.PdfDictionary (pdftk.com.lowagie.text.pdf.PdfNull and pdftk.com.lowagie.text.pdf.PdfDictionary are in unnamed module of loader 'app')
 at pdftk.com.lowagie.text.pdf.PdfReader$PageRefs.iteratePages(PdfReader.java:3420)
 at pdftk.com.lowagie.text.pdf.PdfReader$PageRefs.iteratePages(PdfReader.java:3449)
 at pdftk.com.lowagie.text.pdf.PdfReader$PageRefs.iteratePages(PdfReader.java:3449)
 at pdftk.com.lowagie.text.pdf.PdfReader$PageRefs.readPages(PdfReader.java:3256)
 at pdftk.com.lowagie.text.pdf.PdfReader$PageRefs.<init>(PdfReader.java:3226)
 at pdftk.com.lowagie.text.pdf.PdfReader$PageRefs.<init>(PdfReader.java:3204)
 at pdftk.com.lowagie.text.pdf.PdfReader.readPages(PdfReader.java:925)
 at pdftk.com.lowagie.text.pdf.PdfReader.readPdf(PdfReader.java:523)
 at pdftk.com.lowagie.text.pdf.PdfReader.<init>(PdfReader.java:172)
 at pdftk.com.lowagie.text.pdf.PdfReader.<init>(PdfReader.java:161)
 at com.gitlab.pdftk_java.TK_Session.add_reader(TK_Session.java:126)
 at com.gitlab.pdftk_java.TK_Session.add_reader(TK_Session.java:229)
 at com.gitlab.pdftk_java.TK_Session.open_input_pdf_readers(TK_Session.java:242)
 at com.gitlab.pdftk_java.TK_Session.<init>(TK_Session.java:869)
 at com.gitlab.pdftk_java.pdftk.main_noexit(pdftk.java:150)
 at com.gitlab.pdftk_java.pdftk.main(pdftk.java:128)
Error: Failed to open PDF file:
   1971-simon.pdf
Errors encountered. No output created.
Done. Input errors, so no output created.
$ pdftk --version
pdftk port to java 3.0.9 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2017-2018 Marc Vinyals - https://gitlab.com/pdftk-java/pdftk
Copyright (c) 2003-2013 Steward and Lee, LLC.
pdftk includes a modified version of the iText library.
Copyright (c) 1999-2009 Bruno Lowagie, Paulo Soares, et al.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.