public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Liviu Andronic <landronimirc@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] repair damaged pdf?
Date: Thu, 14 Apr 2011 23:08:53 +0200	[thread overview]
Message-ID: <BANLkTik+UxpGBma_fVNkLpsQL3vaaCv7-Q@mail.gmail.com> (raw)

Dear all
What is your experience with corrupted PDF files? Do you know any tool
that can attempt to repair damaged PDF files? Does it make any sense
to edit a PDF file in hex mode?

I have a damaged PDF that cannot be opened with any of the about 10
tools that I've just tried.
liv@liv-laptop:/tmp$ pdf2ps Class\ 1.pdf
   **** Warning: File has a corrupted %%EOF marker, or garbage after %%EOF.
   **** Warning:  An error occurred while reading an XREF table.
   **** The file has been damaged.  This may have been caused
   **** by a problem while converting or transfering the file.
   **** Ghostscript will attempt to recover the data.
Error: /typecheck in --run--
Operand stack:
   --nostringval--   --nostringval--   1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--
--nostringval--   2   %stopped_push   --nostringval--
--nostringval--   --nostringval--   false   1   %stopped_push   1878
1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3
%oparray_pop   --nostringval--   --nostringval--   --nostringval--
--nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1155/1684(ro)(G)--   --dict:1/20(G)--   --dict:75/200(L)--
--dict:75/200(L)--   --dict:108/127(ro)(G)--   --dict:288/300(ro)(G)--
  --dict:20/25(L)--   --dict:1/10(L)--
Current allocation mode is local
GPL Ghostscript 8.71: Unrecoverable error, exit code 1

liv@liv-laptop:/tmp$ pdftops Class\ 1.pdf
Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Top-level pages object is wrong type (null)
Error: Couldn't read page catalog

Any ideas how I could try to repair it? (It's not sensitive and it's
small, so I could post it.) I tried pdftk, but it also fails.
liv@liv-laptop:/tmp$ pdftk Class\ 1.pdf output Class\ 11.pdf
java.lang.NullPointerException
   at com.lowagie.text.pdf.PdfReader$PageRefs.iteratePages(itext-2.1.7.jar.so)
   at com.lowagie.text.pdf.PdfReader$PageRefs.readPages(itext-2.1.7.jar.so)
   at com.lowagie.text.pdf.PdfReader$PageRefs.<init>(itext-2.1.7.jar.so)
   at com.lowagie.text.pdf.PdfReader$PageRefs.<init>(itext-2.1.7.jar.so)
   at com.lowagie.text.pdf.PdfReader.readPages(itext-2.1.7.jar.so)
   at com.lowagie.text.pdf.PdfReader.readPdf(itext-2.1.7.jar.so)
   at com.lowagie.text.pdf.PdfReader.<init>(itext-2.1.7.jar.so)
   at com.lowagie.text.pdf.PdfReader.<init>(itext-2.1.7.jar.so)
Error: Unexpected Exception in open_reader()
Error: Failed to open PDF file:
   Class 1.pdf
Errors encountered.  No output created.
Done.  Input errors, so no output created.

Regards
Liviu


-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail



             reply	other threads:[~2011-04-14 21:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14 21:08 Liviu Andronic [this message]
2011-04-14 21:30 ` [gentoo-user] repair damaged pdf? Florian Philipp
2011-04-14 22:03   ` Mick
2011-04-14 22:21     ` Liviu Andronic
2011-04-15  8:06   ` Florian Philipp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTik+UxpGBma_fVNkLpsQL3vaaCv7-Q@mail.gmail.com \
    --to=landronimirc@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox