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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - PDF Rendering and Form Fields
  FAQ FAQ  Forum Search   Register Register  Login Login

PDF Rendering and Form Fields

 Post Reply Post Reply
Author
Message
Jack View Drop Down
Team Player
Team Player
Avatar

Joined: 03 Jun 09
Location: Lompoc, CA
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jack Quote  Post ReplyReply Direct Link To This Post Topic: PDF Rendering and Form Fields
    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
Back to Top
Jack View Drop Down
Team Player
Team Player
Avatar

Joined: 03 Jun 09
Location: Lompoc, CA
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jack Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jul 09 at 6:27PM
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.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jul 09 at 6:13AM
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

Back to Top
Jack View Drop Down
Team Player
Team Player
Avatar

Joined: 03 Jun 09
Location: Lompoc, CA
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jack Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jul 09 at 8:45PM
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
Back to Top
Jack View Drop Down
Team Player
Team Player
Avatar

Joined: 03 Jun 09
Location: Lompoc, CA
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jack Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jul 09 at 1:39AM
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.
Back to Top
Michel_K17 View Drop Down
Newbie
Newbie
Avatar
www.exp-systems.com

Joined: 25 Jan 03
Status: Offline
Points: 297
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michel_K17 Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jul 09 at 4:21AM
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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jul 09 at 6:17AM
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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store