Print Page | Close Window

Renaming Fields

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3709
Printed Date: 25 Apr 24 at 10:00PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Renaming Fields
Posted By: PDFNow
Subject: Renaming Fields
Date Posted: 14 May 19 at 8:42AM
Hi.

We got an PDF with Formfields (Parnents and Childs). Now we are renaming the Childfields, so there is no connection anymore to the parent field.

We using "SetFormFieldTitle" to rename and it works. But not in a way we like to.

Example:

Before renaming
Parentfield = "Textbox1"
Childfield = "Textbox1."

After renaming
Parentfield = "Textbox1"
Childfield = "Textbox1.NewName"

We just want the NewName as FormFieldTitle without the Parentname.

Our QuickPDF Version is 11.15.

https://www.dict.cc/englisch-deutsch/Kind.html" rel="nofollow - Kind   https://www.dict.cc/englisch-deutsch/regards.html" rel="nofollow - regards
Wolfgang



Replies:
Posted By: Ingo
Date Posted: 14 May 19 at 5:15PM
Hi Wolfgang,

you should read in the online reference in the description belonging to SetFormFieldTitle;-)
There you can read "...renames the title of a parent form field...". Additionally: "...you have to make sure that the name is unique...".
But this is NOT for child fields.
BTW: I don't know that you've extracted the complete form field name.
Don't know if only QuickPDF has probs with more than one field with the same name but i don't think that your pdf has one name twice?
There's no functionality in the library to rename child fields.
What you can do ( i wouldn't do this) is to remove the child field and use NewChildFormField:
https://www.debenu.com/docs/pdf_library_reference/NewChildFormField.php
...with a new title.




-------------
Cheers,
Ingo



Posted By: waynefulcher
Date Posted: 11 Jun 19 at 10:14PM
You actually can rename a child field. After some searching I found the solution at the bottom of this post, however if I understand your question then you have the exact same issue I have which is not so much renaming a child field but to remove the "parent" leaving only the child field as a normal field.
As Ingo mentioned this could only be done if you do not have duplicate fields with the same name.

In my case I have a PDF and whoever created the fields didn't realize the implication of using periods (.) in the field names. What I want to do is take the following fields:

Beneficial.Owner                 (parent)
Beneficial.Owner.Name        (child)
Beneficial.Owner.Address     (child)

and delete Beneficial.Owner and then replace periods with underscores for the other fields leaving me with only:

Beneficial_Owner_Name
Beneficial_Owner_Address

I am working on a solution for this so if you figure out anything let me know, otherwise if I figure it out I will post it here.



(Solution for renaming a child field)
================================================

It is possible to rename a form field using the  http://www.quickpdflibrary.com/help/quickpdf/SetFormFieldChildTitle.php" rel="nofollow - SetFormFieldChildTitle  function in Quick PDF Library. It works like this:

If you have a parent field called Details, with child fields Name and Address, the full field names will be:

Details.Name
Details.Address

If you wanted to change Details.Name to Details.FirstName you can use:

int FieldID = QP.FindFormFieldByTitle("Details.Name");
QP.SetFormFieldChildTitle(FieldID, "FirstName");


Posted By: Ingo
Date Posted: 12 Jun 19 at 7:22PM
Hi Wayne,

good to see users with samples to help and not always questions ;-)
Please ... if you want you could put this code into the samples-section as well.
Thanks :)



-------------
Cheers,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk