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!
![]() |
FormFields |
Post Reply ![]() |
Author | |
Detlev ![]() Beginner ![]() ![]() Joined: 28 Jan 10 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() Posted: 25 Mar 10 at 3:36PM |
Hi, I use PDF-template with form fields and fill them with values from SQL query fields with the same name. If I need more than one page, all fields we be flatten, the page will be saved and added to a mergelist, and the new template will be loaded. This is the loop: for i := ffc downto 1 do The problem is, that it happens that values will be placed somewhere on the page or the values of one field will be placed in another field too. For a given set of data the behaviour is repeatable. But I cannot find any reason for this. A page more or less and the situation is quiet different. Has anybody any idea what is going wrong and how to debug this? Detlev |
|
![]() |
|
Jack ![]() Team Player ![]() ![]() Joined: 03 Jun 09 Location: Lompoc, CA Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
It sounds like you are attempting to do pretty much what I am doing. Because Acrobat fills in all fields that have the same name as the field you want to fill in with the data you supply for that field you have to accommodate that in your routine. For my purposes, I have to fill in forms that will have "details". Like for instance, I do forms for employer state taxes that have 7 employees per form. When I set up the form, I name the first field something like EmployeeName_01, the next one EmployeeName_02 and so on. Then I append that to the name of the SQL field as I am setting the data.
Because I will have about 20 pages of this kind of data, I also have to prepend the page name to the field name and change the names of the fields on the form in this process so that I am actually sending data to fields named something like 001_EmployeeName_01 and so on. Finally, it has been a long time since I did this and I am working from memory but I think I had a problem with my SQL field names being all upper case and my wanting my form field names to be more understandable, so I had a mismatch because I think QuickPDF was case sensitive. So when I bring in each template, I read all the field names and indexes into a StringList which I can set to be non-case sensitive and then I set the field data by field index. As much as I really like QuickPDF, I don't want to have to deal with their concept of PDFs in the middle of my program, so I wrap QuickPDF up in a class that's a lot easier for me to use. |
|
![]() |
|
Detlev ![]() Beginner ![]() ![]() Joined: 28 Jan 10 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Hi Jack, in my case all form fields have unique names (I did it like you: blabla_01 ...). Some have names all uppercase (these can directly been filled with database field values), others mixed-case (these with a special preprocessing). The problem is with uppercase fields, thats true. I give it a chance with renamed fields. But what about text, which stands at a position where never any form field has been defined? These imaginary positions have some kind of intrinsic systematic: if this problem occur, the text is placed at 1 out of 3 senseless positions. |
|
![]() |
|
Jack ![]() Team Player ![]() ![]() Joined: 03 Jun 09 Location: Lompoc, CA Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
I don't do anything with drawing text, but it looks like it should work. How do you do that in your program?
|
|
![]() |
|
Detlev ![]() Beginner ![]() ![]() Joined: 28 Jan 10 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
This is my workflow:
Meanwhile I think it has to do with CapturePage and DrawCapturedPage. If I flatten form fields before CapturePage the assigned text appears in the resulting PDF as expected, with the exception of the wrong placed once. If I don't flatten before CapturePage, all fields are empty on the final PDF. The PDF reader (Acrobat, Foxit, it doesn't matter) indicates existence of form fields (they aren't flattened), but they won't be shown. A really inconsistent state. |
|
![]() |
|
Detlev ![]() Beginner ![]() ![]() Joined: 28 Jan 10 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Good news: upgrade to version 7.18 solved the problem.
|
|
![]() |
|
Jack ![]() Team Player ![]() ![]() Joined: 03 Jun 09 Location: Lompoc, CA Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
I'm glad that solved the problem. Somewhere down the line I may want to make use of what you are doing to do something like put a logo on a form otherwise drawn from some standard source.
|
|
![]() |
|
Detlev ![]() Beginner ![]() ![]() Joined: 28 Jan 10 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Bad news: in Delphi I use compiler directives to either use library version 7.17 or 7.18. The problem discussed above is solved in version 7.18. But now a new problem comes up. When filling some fields, which aren't different from others (besides the name and the order of processing), an exception is raised. I cannot recognize any systematic which fields or which values are affected. Setting the same text values to other form fields works fine. Any idea would be appreciated. |
|
![]() |
|
Detlev ![]() Beginner ![]() ![]() Joined: 28 Jan 10 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Sorry, once again. In a few days I have a presentation, and my form field error still exists. This is one of the strings, which caused SetFormFieldValueByTitle to fail (keep in mind: only in ONE PDF formular, the same form field copied and pasted in another PDF works fine, copied and pasted back also works, but than the NEXT field fails ???). AUP 2002/2003 des Kreises Aachen, Grube Diepenlinchen Industriestr. 15 Geotechnischer Bericht über Baugrund und Gründung, Stich, Eschweiler In the first line I replaced the dot with the german "aße", and it works. In the second lines removing the comma and the umlaut "ü" doesn't help. This string don't fail: Gutachten zur Untersuchung der Bebaubarkeit des Grundstücks in Stolberg, Flur 68, "In der Dell" Sometimes ffName := PDFLibrary.GetFormFieldTitle(i); results to "." and the program fails. For a given dataset and a given PDF with form fields this behaviour is reproducable. Under different conditions something different happens. I tried the DLL version 7.17, 7.18 and the Delphi version 7.18. Please, has anybody any idea, what could be the reason for these unexpected results? |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3524 |
![]() ![]() ![]() ![]() ![]() |
Hi!
You should use the official support page in this case: http://www.quickpdflibrary.com/support/support-query.php Please upload the specific form and test data, too. Cheers, Ingo |
|
![]() |
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