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!
![]() |
Flattening of XFA field |
Post Reply ![]() |
Author | |
toran ![]() Beginner ![]() Joined: 20 Feb 12 Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() Posted: 14 Apr 14 at 7:35PM |
I am using UpdateAndFlattenFormField method to flatten XFA fields and the method is failing on some of them. Out of 80 fields (all have similar name structure) the method fails on 3 fields with the names:
"form1[0]" "form1[0].#subform[6]" "form1[0].#subform[7]" Perhaps it also fails on other fields that are subfields of the above fields, but the return value indicate success. What could be the problem? Thanks. |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
I think ...
"form1[0]" "form2[0].#subform1[6]" "form3[0].#subform2[7]" ... would work. It's only an idea regarding on similar posts from the past. ;-) Cheers, Ingo |
|
Cheers,
Ingo |
|
![]() |
|
toran ![]() Beginner ![]() Joined: 20 Feb 12 Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() |
Well, the field names that I posted are returned by QPDF Api. Are you suggesting a QPDF bug in processing field names ?
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
no... i only know from the past that it could be difficult dealing with form fields having identical names.
With QuickPDF it's possible to rename fields on the fly while/before processing... Cheers, Ingo
|
|
Cheers,
Ingo |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
Toran,
UpdateAndFlattenFormField is not designed to flatten XFA fields. Adobe uses a strange system where it creates FormFields to match the entries in the XFA XML field description. When the xml is updated it will update the dummy formfield attached to the XFA field so it is not a reliable method to flatten XFA fields.
You can call QP.RemoveXFAEntries to remove the XFA and leave the Acroform fields then you can use SetFormFieldValue to set the formfield. Here is the code you need to use QP.LoadFromFile("i-9.pdf", ""); QP.RemoveUsageRights(); QP.RemoveXFAEntries(0); for (int i = QP.FormFieldCount(); i >= 1; i--) { QP.SetFormFieldValue(i, "111"); QP.UpdateAndFlattenFormField(i); } QP.SetNeedAppearances(0); // Stop Acrobat asking to save the file when closing. QP.SaveToFile("out.pdf"); Andrew |
|
![]() |
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