Print Page | Close Window

Duplicate form fields

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: Sample Code
Forum Description: Share Debenu Quick PDF Library sample code with other forum members
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1820
Printed Date: 03 May 24 at 1:13AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Duplicate form fields
Posted By: Rowan
Subject: Duplicate form fields
Date Posted: 28 Apr 11 at 10:14AM
Quick PDF Library allows you to add duplicate form fields to PDF files. This means that two or more form fields share the same name and if one of the form fields is updated then the other form fields are also updated.

QP.NewFormField('Name', 1);
QP.SetFormFieldBounds(1, 100, 500, 200, 100);
QP.SetFormFieldBorderColor(1, 1, 0, 0);

QP.NewFormField('Name', 1);
QP.SetFormFieldBounds(2, 100, 400, 200, 100);
QP.SetFormFieldBorderColor(2, 0, 1, 0);
QP.SaveToFile('dupfields.pdf');

If you use the GetFormFieldValueByTitle or SetFormFieldValueByTitle functions then these functions will only work with the first occurrence of the field that has that title, it will not work with the duplicate field. So it is better to use the index with the GetFormFieldValue and SetFormFieldValue functions, instead of the title.



Replies:
Posted By: nirnir
Date Posted: 12 May 11 at 1:44PM

Hi,

I couldn't create two fields with same name .
calling NewFormField with existing field name returns
The same field index .
Do you have a Delphi working example of how adding duplicate fields ?


Posted By: iGapper
Date Posted: 06 Jun 11 at 9:08PM
Hi Nirnir,
 
Maybe you could try the release 25 of QuickPDF Library. This version will allow you to add fields with same name.
 
For me, now, it works. Nice job !!
 



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