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!
PDF Rendering and Form Fields |
Post Reply |
Author | |
Jack
Team Player Joined: 03 Jun 09 Location: Lompoc, CA Status: Offline Points: 22 |
Post Options
Thanks(0)
Posted: 14 Jul 09 at 5:54PM |
In my application, I use the QuickPDF library to fill in the fields on government forms. Unfortunately, when I tried RenderPageToStream to copy the form to an image and view the filled in form, the fields are not included. So I tried using this code to flatten the fields and check the results:
for iField := 1 to FQP.FormFieldCount do begin iSuccess := FQP.FlattenFormField(iField); end; FQP.SaveToFile('C:\Documents and Settings\Jack\Desktop\Test Output 2.pdf'); FQP.RenderPageToStream(iDPI, iPage, iOptions, FMS); Only some of the fields get flattened and those that do get flattened are the ones that show up. I suspect that some of the fields might be "child" fields but I never got my head around why people use those or how to deal with them. So, I have two questions. First is whether it might be possible for the library to support form fields in the rendering functions and second is failing the first, do you have any ideas how I might get all the fields to flatten so they will show up in my viewer. Any help is very much appreciated. Jack Edited by Jack - 14 Jul 09 at 5:56PM |
|
Jack
Team Player Joined: 03 Jun 09 Location: Lompoc, CA Status: Offline Points: 22 |
Post Options
Thanks(0)
|
Just a quick update. None of the fields are child fields. Of the first half-dozen or so fields, the first, fourth, fifth and eighth fields were flattened, while, the second, third, sixth and seventh were not. The overall appearance of the form and the flattened fields in the preview is very good. Flattening the fields would seem to work just fine for my purposes.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Jack!
It would be helpful to see your pdf form but ... It's possible to set form field properties like "not printable" or "not visible"... Perhaps this is the answer to your questions? ffc := QP.FormFieldCount; if ( ffc < 1 ) Then Exit; // . . . for i := 1 to ffc do begin // . . . ffname := QP.GetFormFieldTitle(i); ffprt := IntToStr(QP.GetFormFieldPrintable(i)); ffvis := IntToStr(QP.GetFormFieldVisible(i)); // . . . Cheers, Ingo |
|
Jack
Team Player Joined: 03 Jun 09 Location: Lompoc, CA Status: Offline Points: 22 |
Post Options
Thanks(0)
|
Thanks for your input, Ingo. Following your suggestion, I started testing to see if I could isolate the problem. It is taking a while. I will get back with results.
Jack |
|
Jack
Team Player Joined: 03 Jun 09 Location: Lompoc, CA Status: Offline Points: 22 |
Post Options
Thanks(0)
|
Ingo,
I followed up on your suggestion. I continued to get only partial flattening of the fields and I could see no difference between the fields that got flattened and those that did not. Then, it dawned on me that there WAS a pattern to the way the fields were getting flattened and that was that every other field got flattened. So, when a field gets flattened, it is no longer a field and the fields above that field move down one and if you increment your pointer, you will skip every other field. I changed my loop to a downto loop and the problem was solved. Thanks for your help. |
|
Michel_K17
Newbie www.exp-systems.com Joined: 25 Jan 03 Status: Offline Points: 297 |
Post Options
Thanks(0)
|
Hi,
You are not the first one to experience this. Congratulations on figuring it out. You are absolutely write: flattening a field reduces the field count by one. Cheers! Michel |
|
Michel
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi!
So it's the best to get the FormFieldCount first in a separate variable and then doing the flattenloop with these variable... @Jack: It looks like you can be a help for others here very soon ;-) 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