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 - How do you Delete/Remove child form fields?
  FAQ FAQ  Forum Search   Register Register  Login Login

How do you Delete/Remove child form fields?

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


Joined: 26 Sep 12
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote idolpx Quote  Post ReplyReply Direct Link To This Post Topic: How do you Delete/Remove child form fields?
    Posted: 06 Nov 12 at 11:27PM
When I call the DeleteFormField function with the ID of the child form field it deletes the parent too.
But if I save the document to a file all of the form fields are still there.

I'm using v7.26 of the library at the moment.  
I'm going to try the current version and see if that fixes it.

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: 07 Nov 12 at 3:14AM
Do you have any sample code we can look at ?

Here is some test code I wrote that is performing as expected in 9.12

            QP.LoadFromFile("formfields_2parents2children.pdf", "");

            int c = QP.FormFieldCount();
            string s = "Before DeleteFormField() - Count=" + c.ToString() + "\n";

            for (int i = 1; i <= c; i++)
                QP.SetFormFieldValue(i, i.ToString() + "_" + QP.GetFormFieldValue(i));

            for (int i = 1; i <= c; i++)
                s += String.Format("{0} : Name={1} : Value={2}\n", QP.GetFormFieldType(i), QP.GetFormFieldTitle(i), QP.GetFormFieldValue(i));

            QP.DeleteFormField(6);
            QP.DeleteFormField(2);

            c = QP.FormFieldCount();
            s += "After DeleteFormField() - Count=" + c.ToString() + "\n";

            for (int i = 1; i <= c; i++)
                s += String.Format("{0} : Name={1} : Value={2}\n", QP.GetFormFieldType(i), QP.GetFormFieldTitle(i), QP.GetFormFieldValue(i));
            MessageBox.Show(s);

            QP.SaveToFile("out.pdf");
            Process.Start("out.pdf");

Before DeleteFormField() - Count=6
7 : Name=F1 : Value=
1 : Name=F1.Child1 : Value=2_F1.Child1.Text
1 : Name=F1.Child2 : Value=3_F1.Child2.Text
7 : Name=F2 : Value=
1 : Name=F2.Child1 : Value=5_F2.Child1.Text
1 : Name=F2.Child2 : Value=6_F2.Child2.Text
After DeleteFormField() - Count=4
7 : Name=F1 : Value=
1 : Name=F1.Child2 : Value=3_F1.Child2.Text
7 : Name=F2 : Value=
1 : Name=F2.Child1 : Value=5_F2.Child1.Text

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