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 > General Discussion
  New Posts New Posts RSS Feed - SetFormFieldValue and text width
  FAQ FAQ  Forum Search   Register Register  Login Login

SetFormFieldValue and text width

 Post Reply Post Reply
Author
Message
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Topic: SetFormFieldValue and text width
    Posted: 09 Mar 06 at 7:22AM
I'm using QuickPDF to stuff data into empty form fields of template PDFs. So, for instance, I have on my VBScript :

obj.SetFormFieldValueByTitle("NAME","JOSE ADRIANO BALTIERI")

The problem is :

Sometimes the field content is larger than the designed form field. So, data is truncated when the PDF is printed. If I load the PDF, I can "see" the data by scrolling within the field. But I need it to be printed OK, because my main goal is to print the PDF.

Finally , my question is :

Is it possible to detect when data may be truncated, that is, to detect this size error ?

Something like :

obj.SetFormFieldValueByTitle("NAME","JOSE ADRIANO ALTIERI")
if DATATRUNCATED
    do something to warn
endif

Thanks in advance for your support !
Back to Top
bogey View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Nov 05
Location: United States
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote bogey Quote  Post ReplyReply Direct Link To This Post Posted: 09 Mar 06 at 7:36AM

I don't know that you could determine exactly how many characters can fit a form field based on the size and the getFormFieldTextSize, but you can override the font to "auto" which will scale long text down till it fits in the blank.

Set the font using SetFormFieldTextSize(index,0).

Of course you may also run into potential problems with the design department or law department if you adjust font sizes without their knowledge.

Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 09 Mar 06 at 8:09AM
I'm afraid I should not change any text properties.

My principle here is that my client, that is, my final user, designs the template. He/she chooses the lay out by drawing the form using Open Office and then exporting it to PDF.

So, the principle is to respect this design.

What I want is to detect problems while I'm stuffing data into this design or template.

So, the approach is to tell the final user that the field that he/she designed for "NAME" is not large enough.

He/She should fix the template.

Got it ?
Back to Top
bogey View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Nov 05
Location: United States
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote bogey Quote  Post ReplyReply Direct Link To This Post Posted: 09 Mar 06 at 8:18AM

I fully agree the issue need to go back to the form designer. Either show them how to set the fontsize to "auto", or tell them that overflows cannot be controlled. I don't think there is an "overflow" function to detect the problem.

You could make an estimate if it is a fixed-pitch font. For example, if you know it is a courier 10 font in the field, you could calulate the characted that could be displayed by dividing the size by the character pitch. But this would only be an approximation for most fonts.

Back to Top
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Posted: 09 Mar 06 at 8:42AM
Not always the Auto is a good aproach cause it is very common that the user designs a box around the field, that is, a framing box.

In any case however, this box will step over the adjoining fields.

So, I really need QuickPDF to monitor when a form field is stepping over someone else's toes !
Back to Top
bogey View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Nov 05
Location: United States
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote bogey Quote  Post ReplyReply Direct Link To This Post Posted: 09 Mar 06 at 10:20AM

The "auto" text size will reduce the text to fit the existing field. Not expanding the box.

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

Joined: 28 Nov 05
Location: Sweden
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote PDFman Quote  Post ReplyReply Direct Link To This Post Posted: 10 Mar 06 at 7:55AM

Why not read back the value after writing it. Then compare the strings and give a message to the user if they do not compare.

 

Best regards,

/Stefan

Back to Top
bogey View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Nov 05
Location: United States
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote bogey Quote  Post ReplyReply Direct Link To This Post Posted: 10 Mar 06 at 8:39AM

Because the data is going into the field, only getting truncated visually. Reading it back would bring back the full value.

 

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