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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Flattening of XFA field
  FAQ FAQ  Forum Search   Register Register  Login Login

Flattening of XFA field

 Post Reply Post Reply
Author
Message
toran View Drop Down
Beginner
Beginner


Joined: 20 Feb 12
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote toran Quote  Post ReplyReply Direct Link To This Post Topic: Flattening of XFA field
    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.

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 20 Apr 14 at 5:13PM
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

Back to Top
toran View Drop Down
Beginner
Beginner


Joined: 20 Feb 12
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote toran Quote  Post ReplyReply Direct Link To This Post Posted: 22 Apr 14 at 2:15AM
Well, the field names that I posted are returned by QPDF Api. Are you suggesting a QPDF bug in processing field names ?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 22 Apr 14 at 7:22AM
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

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 22 Apr 14 at 1:43PM
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store