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!
![]() |
How do you Delete/Remove child form fields? |
Post Reply
|
| Author | |
idolpx
Beginner
Joined: 26 Sep 12 Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
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