Print Page | Close Window

Form fields with same name

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=3576
Printed Date: 23 Jul 19 at 4:18PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Form fields with same name
Posted By: geonetwork
Subject: Form fields with same name
Date Posted: 05 Jun 18 at 12:00PM
In my applications I have some fields across more pages that share the same name and if one of the form fields is updated then the other form fields are also updated.
Since version 13 is not more longer possible to have more fields with same name!

If you try to compile the code with version 12 all it's ok: three fields with same name that share same value. With version 13, 14 and 15 there will be only one field!

procedure TForm1.Button1Click(Sender: TObject);
var
  QP: TDebenuPDFLibrary;
  nFieldIndex: integer;
  nFieldCount: integer;
  i,n: integer;
begin
  QP:=TDebenuPDFLibrary.Create;
  try
    QP.UnlockKey('xxxxxxxxxxxxxxxxxxxxxx');
    QP.SetOrigin(1);
    QP.SetMeasurementUnits(1); // mm.
    QP.SetPageDimensions(210, 297); // A4
    QP.SetTextColor(0,0,0);
    QP.SelectPage(n);
    nFieldCount:=1;
    QP.AddFormFont(QP.GetFontID(4));
    QP.SetTextSize(10);
    for i:=1 to 3 do begin
      nFieldIndex:=QP.NewFormField('FIELD'+IntToStr(nFieldCount),1);
      QP.SetFormFieldBounds(nFieldIndex,40,46+(i-1)*15,100,5);
      QP.SetFormFieldAlignment(nFieldIndex,0);
      QP.SetFormFieldStandardFont(nFieldIndex,4);
      QP.SetFormFieldTextSize(nFieldIndex,0);
    end;
    Inc(nFieldCount);
    QP.SaveToFile('c:\temp\output.PDF');
  finally
    QP.Free;
  end;
end;

Is this a bug? Is there any workaround?



Replies:
Posted By: Ingo
Date Posted: 06 Jun 18 at 8:31PM
I think version 12 had the bug ;-)
As far as i know it works like it's designed - only unique formfield names.




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



Posted By: geonetwork
Date Posted: 07 Jun 18 at 10:24AM
Hello Ingo, thank you for your reply.

It isn't a bug of version 12. The behavior is the same with version 10 and with the prior versions (i'm using QuickPdf since version 5)

In my opinion is not possible to prevent the inclusion of two fields with the same name at a random time, without considering the past. 

How can I justify this change to my customers? I can't tell their: "you have to repeat the usual header for each page of the document"!

I add that in the documentation of version 13 there is no reference to this change and that Adobe Acrobat allows you to do it without problems since the first version.

I also wrote to the support


Posted By: Ingo
Date Posted: 08 Jun 18 at 7:59PM
This is a user-forum for helping users.
I've told you the official statements from the publishers regarding form field names.
That's all i can say.
If you're a user starting from version 5 (i was only a little bit earlier) then you shouldn't ask ;-)
There's no need to tell it to your customers.
You can change form field names programmatically (adding the actual page number should be enough).
To which support you've written?
Perhaps it's the wrong one cause the Debenu team moved to Foxit?



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



Posted By: geonetwork
Date Posted: 11 Jun 18 at 8:16AM
Ok, I'm sorry, I will not make this mistake again.

Just for the sake of precision: I know that I can change the names of the fields, but that's not what I want. I want that if a user writes something in the "name" field of the first page (after it has been created), he will also find it in the second and third pages. Until version 12 the PDFs created by my applications allowed it, now no more. That's all.

P.S. in the meantime the support has answered me and they are investigating the problems


Posted By: geonetwork
Date Posted: 13 Jun 18 at 9:08AM
The technical support has suggested me a workaround. To make the fields work again as in version 12 and earlier (possibility to specify more form fields with the same name that automatically take the same value and other little different behaviors) simply insert the instruction:

QP.SetNeedAppearances(1);

since version 13, in fact, the default value of this flag is changed (of course there is a technical explanation behind this change ...)





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