Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Security settings for PDF forms |
Post Reply |
Author | |
galcott
Beginner Joined: 07 May 09 Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 07 May 09 at 10:03PM |
I am testing the library now and I need to fill in some form fields in an existing PDF then save the file under another name. When I do this, the new file opens in Acrobat with a message saying that the extended features are no longer available, and the form fields are no longer available for input. I need them to be available and would like to know how to do this. Here is the test code I am using:
procedure TForm1.Button1Click(Sender: TObject); var PDF: TQuickPDF0713; ep: integer; begin PDF:=TQuickPDF0713.Create; PDF.LoadFromfile('c:\test1.pdf'); PDF.SetFormFieldValue(1, '123'); PDF.SetFormFieldValue(2, 'This is a test'); ep:=PDF.EncodePermissions(1,1,1,1,1,1,1,1); PDF.Encrypt('','',1,e); PDF.SaveToFile('c:\test2.pdf'); end; |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi galcott!
Below you'll find the code i'm using to set formfield-values. It'll work for you, too. You should try your code with a "ep" instead of "e" in the Encrypt ;-) Cheers, Ingo QP := TQuickPDF713.Create; try QP.UnlockKey('MyKey'); QP.LoadFromFile(FileName); If ( QP.Encrypted > 0 ) then QP.Unencrypt; ffc := QP.FormFieldCount; // there are different ways to set formfields. // With the appearance-functionality we can set // a field value (and it is visible) but we can // still overwrite it because it is still a formfield. // With the flatten-functionality AFTER setting a field- // content the fields will be converted to normal text. if ffc > 0 then // Are there any formfields? begin // first version with setting via fieldindex QP.SetNeedAppearances(1); QP.SetFormFieldValue( 1, 'my first value' ); QP.UpdateAppearanceStream( StrToInt(Trim(FieldName)) ); // if we use the next line it will be text and no longer fieldcontent // QP.FlattenFormField( 1 ); { // second version with setting via fieldname. // You can get the names via GetFormFieldTitle. QP.SetNeedAppearances(1); QP.SetFormFieldValueByTitle( 'field1', 'my first value' ); nresult := QP.FindFormFieldByTitle('field1'); QP.UpdateAppearanceStream(nresult); // if we use the next line it will be text and no longer fieldcontent // QP.FlattenFormField( nresult ); } end; finally QP.SaveToFile(FileName); QP.Free; end; Edited by Ingo - 08 May 09 at 1:36AM |
|
galcott
Beginner Joined: 07 May 09 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
I did have the correct variable in my code; I must have deleted a character when composing the message.
But this doesn't solve my problem. The message still comes up in Acrobat and the fields are no longer available to edit. On the security tab of the document properties page, filling of form fields is listed as not allowed. I need this to be allowed and I thought the EncodePermissions would do that, but it doesn't. So how can I accomplish this? Glenn |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Is the pdf already encrypted before?
Then first unencrypt it. Do you see the values you inserted in the fields? Cheers, Ingo |
|
galcott
Beginner Joined: 07 May 09 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
I did unencrypt it, with no difference. I do see the values I inserted, but the form is no longer available to fill in.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi!
Then you didn't do it like i've described before? Is it always this way or only one special file? Cheers, Ingo Edited by Ingo - 12 May 09 at 1:35AM |
|
galcott
Beginner Joined: 07 May 09 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
I've tried 3 different files with the same result.
I was also trying another product (Gnostice PDF Toolkit) that has similar functionality, and had a similar problem. I contacted their support and they told me that it was an issue with "usage rights" which is a recently added feature of Adobe that they don't support yet. Is it the same issue with QuickPDF? |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
So i think these files are all from the same producer.
Are they working with non-standard-security handlers? That can be the reason (like gnostice told you already). A missing special security handler you can only get from the producer of the document. @All: In cases like this it's always better if you send sample-files. Cases having to do with access-rights and / or security handlers can be determined immediately. Cheers, Ingo |
|
galcott
Beginner Joined: 07 May 09 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
The files are not from the same producer and I don't know anything about their security settings. Please download them from this link and let me know if you can find anything. Thanks.
http://www.galcott.com/pdf_files.zip Glenn |
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
|
Hi Glenn,
The PDFs in your attachment have had extended usage rights added to them by Adobe LiveCycle Designer (or a similar Adobe related product). So when you use Quick PDF Library to modify the file (or any other non-Adobe product), it is corrupting the extended features in some way and then as a result Adobe Reader is showing you the error message about extended features no longer being available. If you want to use Quick PDF Library with these PDFs then you will need to open the PDFs in Adobe Acrobat and choose File > Save a Copy... this will remove the extended features from the PDF and allow you to then modify the PDF without any further problems. I have written a knowledge base article about Adobe Reader Extensions / Usage Rights that you might find useful. Cheers, - Rowan. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store