Print Page | Close Window

Got a wierd PDF form

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=1666
Printed Date: 26 Jun 24 at 7:16AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Got a wierd PDF form
Posted By: vizacc
Subject: Got a wierd PDF form
Date Posted: 02 Dec 10 at 4:28PM
I got a weird PDF form which opens in QuickPDF library and ends up corrupted. Is there any way to pay for priority support to fix QuickPDFLibrary so that the form will be opened and saved correctly?

It is ticket #3894.



Replies:
Posted By: vizacc
Date Posted: 02 Dec 10 at 4:31PM
I'm willing to pay premium or super-premium to get the QuickPDF library to save and load correctly.
The deadline is tomorrow.. :|


Posted By: Ingo
Date Posted: 02 Dec 10 at 5:15PM
Hi!
 
That's a pity for your case ...
Since tomorrow you won't get help i think.
For such a call this is the completely wrong forum.
Here's the user-user-forum - not the author-user-forum ;-)
Please have a look on http://www.quickpdflibrary.com - www.quickpdflibrary.com ...
Here you'll find the options about buying the library:
http://www.quickpdflibrary.com/store/quickpdf/index.php - http://www.quickpdflibrary.com/store/quickpdf/index.php
There's no item for special support but for the source code...
so you can have a look by yourself.
 
BTW: I think a sentence like "...a weird PDF form which opens in QuickPDF library and ends up corrupted..." isn't much if you're looking for help. Shall we have a look in the glass ball guessing what's perhaps the problem?
Post all relevant code and give us an online location where we can find your problem pdf.
You're registered here since 2007... I'm wondering, i'm wondering.
Here is the link to the official support (you should already know):
http://www.quickpdflibrary.com/support/index.php - http://www.quickpdflibrary.com/support/index.php
 
Cheers and good luck,
Ingo
 


Posted By: vizacc
Date Posted: 02 Dec 10 at 5:21PM
I have source codes, latest for QuickPDFLibrary, I tried to fix, but the form is corrupted. Can I contact you via private message?



Posted By: vizacc
Date Posted: 02 Dec 10 at 5:26PM
The source is:

qp.loadfromfile('file.pdf');
qp.savetofile('file2.pdf');
// pdf goes haywire after that.

I can give the PDF, but I cannot give to all because it is confidential.


Posted By: Ingo
Date Posted: 02 Dec 10 at 5:26PM
What do you want?
The file is corrupt ... so it's corrupt ... and that's the correct result.
QuickPDF can't repair pdf forms.
What you can do is calling PageCount...
If the result is 0 then you know that's there is a severe problem with the pdf.
Another easier way is to check the result from LoadFrom...
BTW: I'm a user - not an author of QuickPDF ;-)
 
Cheers, Ingo
 


Posted By: Rowan
Date Posted: 03 Dec 10 at 7:58AM
The PDF that you have sent through is a malformed PDF. It has a syntax issue with the Tabs key and its /W value. The easiest way to get around this syntax error is to completely remove the Tabs key from each page in your document. You can remove the Tabs key using this Delphi code:

 for i := 1 to PDFLibrary.PageCount do
 begin
   TPDFDocument(PDFLibrary.SelectedDocument).PageTree.GetPage(i).DeleteEntryByKeyName('Tabs');
 end;

The /W value for the Tabs key is not currently part of the latest PDF specification. /W means "Widget order" and is described in implementation note 77 of the Acrobat Supplement to the ISO32000 specification and needs ExtensionLevel3. At the moment I believe it's only supported in Adobe Reader 9 and Acrobat 9 and newer versions of these products.

We will add support for it if it is officially added to the next ISO standard for PDF, but until then, you'll have to use the workaround of removing the Tabs key entirely as we do not support non-standard features in PDF files.


Posted By: Ingo
Date Posted: 03 Dec 10 at 8:19AM
Hi Rowan!

Wow...
Thanks a lot for such deeply information!
I see that QuickPDF is in the right hands ;-)

Cheers, Ingo


Posted By: vizacc
Date Posted: 03 Dec 10 at 10:28AM

 QuickPdfLibrary.LoadFromFile('ThatForm.pdf')
 for iNo := 1 to PDFLibrary.PageCount do
 begin
 TPDFDocument(
QuickPdfLibrary.SelectedDocument).PageTree.GetPage(iNo).DeleteEntryByKeyName('Tabs');
 end;
 QuickPdfLibrary.SaveToFile('ThatForm.pdf');

Adobe complains:
This document enables extended features in Adobe Acrobat Reader. This
document has been changed since it was created and use of extended
feature is no longer available. Please contact the author for the
original version of this document.

Any ideas? :(



Posted By: vizacc
Date Posted: 03 Dec 10 at 10:30AM
or, after you save to file, the form becomes unfillable.



Posted By: Ingo
Date Posted: 03 Dec 10 at 10:42AM
Hi Vizacc!

Adobe don't like that you modify THEIR pdf-forms with a third party tool.
Adobe is then abused 'cause they want to be the only one earning money with the pdf-format.
Use the fabulous Foxit Reader and you can still work on the form.
There isn't another solution available... You can say fu...k Adobe - that's all.
Read my blog and you'll know what i mean:
http://pdfcomments.blogspot.com/2009/06/pdf-and-forms.html

Cheers, Ingo



Posted By: Rowan
Date Posted: 03 Dec 10 at 10:44AM
Yes, the forms that Acrobat and LiveCycle create with these extended features and usage rights that help to unlock features in Adobe Reader are exceedingly annoying. Unfortunately, once you've created one of these PDF files the only way to 'get out of jail' is to go back to Acrobat and try to re-save the form without these "extended features".


Posted By: vizacc
Date Posted: 03 Dec 10 at 10:46AM
Is there codes to "fix" this problem? If it is, can I buy it?



Posted By: vizacc
Date Posted: 03 Dec 10 at 10:49AM
Is there a way to remove the "Extended Features"?



Posted By: vizacc
Date Posted: 03 Dec 10 at 10:51AM
Meaning, is there a way to remove these Extended features by Using QuickPDFLibrary?



Posted By: Rowan
Date Posted: 03 Dec 10 at 10:57AM
No, it's not possible to remove these extended features using Quick PDF Library. I'm not sure if this is a feature we can add, but I'll investigate and hopefully we'll be able to add something useful in this area next year.

You can however check to see if a PDF contains these usage rights (e.g. Reader Extensions) using the GetAnalysisInfo function.

http://www.quickpdflibrary.com/help/quickpdf/GetAnalysisInfo.php - http://www.quickpdflibrary.com/help/quickpdf/GetAnalysisInfo.php


Posted By: Rowan
Date Posted: 03 Dec 10 at 10:58AM
To remove usage rights (Reader Extensions) you need to go back to the application were this PDF was originally created (presumably Acrobat or Adobe LiveCycle) and then re-save it without these usage rights.

Adobe really should provide a warning to their users who create these sorts of PDF forms, but unfortunately, they don't.


Posted By: vizacc
Date Posted: 03 Dec 10 at 11:48AM
Rowan, Igno, thank you.
I told the customer this couldn't be fixed.  :(

Thank you.




Posted By: vizacc
Date Posted: 03 Dec 10 at 11:55AM
I'll honor my promise anyway...

Ingo, can you contact me with your email PayPal address?



Posted By: Ingo
Date Posted: 03 Dec 10 at 12:58PM
Hi Vizacc!

There's a way to solve the problem... ;-)
Loading the document and keep type, style and position of each form field in mind.
Then making a jpg from each page.
Then making these jpg to new pdf-pages.
Then creating the form fields with the style data (still in mind) on each page.
In the end you've made forms very similar to the original one without the problems.

This is only an idea from me...
Perhaps one day i'll make a component doing this ;-)

Cheers, Ingo



Posted By: toyet
Date Posted: 06 Dec 10 at 8:31AM
I experienced similar problem.  I googled for the error itself and I got this line "Reinstall Acrobat with version lower than 9.  

Did not have time to test though, sorry!  But, it's worth a try.  And please let me know.  Thanks. :)




Posted By: Ingo
Date Posted: 06 Dec 10 at 8:29PM
Hi!
 
This won't really help.
Imagine: You get the form from anywhere made with Acro 9 ...
Or another thought: Do you want to tell anybody that he shall disable his new expensive Acro 9 and that he shall use again the old Acro 8 or 7?
The usage rights for the Reader Extensions should be anywhere in the pdf-content.
Detecting the tags and removing the tag in a clear way could be a solution?
If here are some guys with such described trouble forms you can send them to me at:
ingo   dot   schmoekel   at   ewetel   dot   net
Thanks in advance!
 
Cheers, Ingo
 



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