Print Page | Close Window

corrupt XREF sections

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=530
Printed Date: 14 May 24 at 12:10PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: corrupt XREF sections
Posted By: ukobsa
Subject: corrupt XREF sections
Date Posted: 06 Oct 06 at 5:02AM
Hi all,

sometimes I get pdfs from our customers with a corrupt xref section and cannot open it with QuickPDF. I know that it is possible to repair them with pdftk but I need a solution to do this with QuickPDF.
As I have not found anything in QuickPDF to do such a repair: has someone implemented such a functionality and would be willing to shared the code?
Or how would you implement such a repair functionality?

Thankx,
Uli



Replies:
Posted By: Ingo
Date Posted: 06 Oct 06 at 5:28AM
Hi Uli!

With QuickPDF you can only test if a pdf is valid or not (CheckObjects). Chicks told in an older postings how to use pdftk in such a case. It's opensource - perhaps you can detect the relevant code-parts in pdftk? Or you can implement pdftk in your solution via shell/shellexecute...

Best regards,
Ingo


Posted By: ukobsa
Date Posted: 06 Oct 06 at 6:22AM
Hi Ingo,

I just looked for CheckObjects in source code, but this seems to do nothing really useful: it needs the document being already loaded by QuickPDF and then only decodes each object. And it doesn't returns a result of the check.
So it doesn't help to check for xref sections.
But thanks for giving this hint!

greetings,
Uli


Posted By: marian_pascalau
Date Posted: 26 Oct 06 at 7:16AM

Hi Ulrich,

send please a test sample to me. I will check your error and propose a sollution.

Gruß, Marian



Posted By: ukobsa
Date Posted: 26 Oct 06 at 8:24AM
Marian,

the problem with invalid XREFs mostly is caused by a wrong startxref values or invalid object positions on xref entries. What I tried to find is a way to rebuild an xref section from ground up.

greetings,
Uli



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk