From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QAU8Y-0001EO-Ab for garchives@archives.gentoo.org; Thu, 14 Apr 2011 21:31:38 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2FE651C04F; Thu, 14 Apr 2011 21:30:13 +0000 (UTC) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by pigeon.gentoo.org (Postfix) with ESMTP id F3A821C04F for ; Thu, 14 Apr 2011 21:30:12 +0000 (UTC) Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.messagingengine.com (Postfix) with ESMTP id BA38921046 for ; Thu, 14 Apr 2011 17:30:12 -0400 (EDT) Received: from frontend2.messagingengine.com ([10.202.2.161]) by compute3.internal (MEProxy); Thu, 14 Apr 2011 17:30:12 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:subject:references:in-reply-to:content-type; s=smtpout; bh=svSTFrzkH7XbN4i2vGC7wc07SXw=; b=dydUVENXaI0+Gu0unahdYu+q1ZLnOBzPYwJ9zsERsk6mEf/Sm0RYHPs1f1tlx+y151ZKd1q3lCatabJoHRMYn8/wHukxZxbDD9eD5xAJlTX1f7a6xAVnVRsUPoccbG4+mGUDdR/7yzJeOSjNx6RcRP9lsxXQVPIpyty93Y4YaWM= X-Sasl-enc: tAN6amSBJg7ropgOUMODMut8lA5HmWltQIwjQFSefms/ 1302816611 Received: from [192.168.5.18] (serv.binarywings.net [83.169.5.6]) by mail.messagingengine.com (Postfix) with ESMTPSA id D85B1444477 for ; Thu, 14 Apr 2011 17:30:10 -0400 (EDT) Message-ID: <4DA76759.7050606@binarywings.net> Date: Thu, 14 Apr 2011 23:30:01 +0200 From: Florian Philipp User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110313 Lightning/1.0b3pre Thunderbird/3.1.9 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] repair damaged pdf? References: In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig901860D2BE4FC1B06869B456" X-Archives-Salt: X-Archives-Hash: fc4b99952ddb3553ac15832e60eccbd2 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig901860D2BE4FC1B06869B456 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 14.04.2011 23:08, schrieb Liviu Andronic: > 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? >=20 > 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 >=20 > 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 >=20 > 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= =2Eso) > at com.lowagie.text.pdf.PdfReader$PageRefs.(itext-2.1.7.jar.so= ) > at com.lowagie.text.pdf.PdfReader$PageRefs.(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.(itext-2.1.7.jar.so) > at com.lowagie.text.pdf.PdfReader.(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. >=20 > Regards > Liviu >=20 >=20 Well, you could try app-text/qpdf from the benf overlay. It has an option to suppress recovery of damaged files so it looks like it at least tries to repair them per default. If you don't want to install layman and overlays, you can send me the file off-list and I take a look. One good thing about PDF is that its structure is stored uncompressed (AFAIK it only compresses text and binary data with zlib since version 1.2). This means that it might be at least partially recoverable. Regards, Florian Philipp --------------enig901860D2BE4FC1B06869B456 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2nZ10ACgkQqs4uOUlOuU/50wCfdJPyPeQGKbwhKY/sKjzPINEh I1QAmgKdzxvAiXnBmPtAvocN0i2srOWd =Y2ei -----END PGP SIGNATURE----- --------------enig901860D2BE4FC1B06869B456--