Print Page | Close Window

Form Field Flatten

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=2572
Printed Date: 29 Jun 24 at 2:37AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Form Field Flatten
Posted By: lambda
Subject: Form Field Flatten
Date Posted: 19 Mar 13 at 3:37PM
Hi all,
I use SetFormFieldValue to fill form from datadase in an web application.
this works great but I need to make the document flat after this.
so Use UpdateAndFlattenFormField.
the problem is that the flatten text is offset downward:

Before Flattening:



After Flattening:



Any idea why this would be happening?
thanks



Replies:
Posted By: Rowan
Date Posted: 22 Mar 13 at 1:29AM
Hi lambda,

Thanks for your email.

Can you please upload the PDF that you are testing with before and after it has been filled and flattened?

Cheers,
- Rowan.


Posted By: lambda
Date Posted: 22 Mar 13 at 11:10AM
Hi thanks for your reply,
I could not find a way to upload them so please find them as a share linked for dropbox

https://www.dropbox.com/s/mnppt4di15g75mw/With%20normal%20fields.pdf - https://www.dropbox.com/s/mnppt4di15g75mw/With%20normal%20fields.pdf

https://www.dropbox.com/s/z3akv1k8uw7rtcj/With%20Flatten%20fields.pdf - https://www.dropbox.com/s/z3akv1k8uw7rtcj/With%20Flatten%20fields.pdf

it looks like the flatten add some padding inside the field box.

the app takes the blank form created in word with cenopdf. and fill the fields from database using the field id:

if text length is bigger than 150 the font is set to 0 to fit shrink to fit. ( very nice feature by the way).

  For i As Integer = 0 To LoA.Count - 1
                Dim Fid As Integer = 0
                Fid = QP.FindFormFieldByTitle(LoA(i).PDFID)
                If Fid = 0 Then Throw New Exception("Field ID " & LoA(i).PDFID & " Not Found in " & BlankForm)
                If LoA(i).FieldType = "txt" Then

                    If LoA(i).Ans.Length > 150 Then
                        QP.SetFormFieldTextSize(Fid, 0)

                    Else
                        QP.SetFormFieldTextSize(Fid, 10)
                    End If
                    QP.SetFormFieldColor(Fid, 0, 0.4, 1)
                    QP.SetFormFieldTextFlags(Fid, 1, 0, 0, 0, 1)
                    If QP.SetFormFieldValue(Fid, LoA(i).Ans) < 1 Then Throw New Exception("Fail to fill in Field Value")


                End If

            Next

            'While FieldCount > 0
            '    QP.UpdateAndFlattenFormField(FieldCount)
            '    FieldCount -= 1
            'End While



Posted By: AndrewC
Date Posted: 25 Mar 13 at 11:18PM
Which version of QPL are you using to flatten the formfields ?


Posted By: lambda
Date Posted: 26 Mar 13 at 3:39PM
DebenuPDFLibraryDLL0911,

Look like it is recent enough

thanks


Posted By: lambda
Date Posted: 12 Apr 13 at 8:07AM
Any idea why this is behaving in that way?


Posted By: AndrewC
Date Posted: 15 Apr 13 at 9:05AM

It is happening because Acrobat decided to change the border width calculations if the formfield is set to be a multi-line formfield.   I did a quick test with other PDF Viewers and many of them also dont render the formfields in the same vertical position as Acrobat does. 

I have made some changes to QPL 9.14 Beta 3 so that the appearance stream created by flattening will more closely match that of Acrobat for multi-line formfields.  9.14 beta 3 will be released sometime this week hopefully.

Andrew.


Posted By: lambda
Date Posted: 15 Apr 13 at 9:52AM
Many thanks for your support


Posted By: AndrewC
Date Posted: 18 Apr 13 at 11:06AM
DQPL 9.14 Beta 3 contains improvements to more closely match output from Acrobat.

It can be downloaded from here

http://www.debenu.com/blog/debenu-quick-pdf-library-9-14-beta-3-released.html

Andrew.


Posted By: lambda
Date Posted: 19 Apr 13 at 2:07PM
Yes that's definitely an improvement. It is also linked to the field height.
For one line fields, making the field narrow enough make for very good match between field and flattened text.
many thanks.



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