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!
SetFormFieldValue and text width |
Post Reply |
Author | |
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
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 ! |
|
bogey
Senior Member Joined: 30 Nov 05 Location: United States Status: Offline Points: 50 |
Post Options
Thanks(0)
|
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. |
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
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 ? |
|
bogey
Senior Member Joined: 30 Nov 05 Location: United States Status: Offline Points: 50 |
Post Options
Thanks(0)
|
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. |
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
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 ! |
|
bogey
Senior Member Joined: 30 Nov 05 Location: United States Status: Offline Points: 50 |
Post Options
Thanks(0)
|
The "auto" text size will reduce the text to fit the existing field. Not expanding the box. |
|
PDFman
Team Player Joined: 28 Nov 05 Location: Sweden Status: Offline Points: 17 |
Post Options
Thanks(0)
|
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 |
|
bogey
Senior Member Joined: 30 Nov 05 Location: United States Status: Offline Points: 50 |
Post Options
Thanks(0)
|
Because the data is going into the field, only getting truncated visually. Reading it back would bring back the full value.
|
|
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