[FX.php List] Display text within a static-sized rectangle (for eventual printing)?

Joel Shapiro jsfmp at earthlink.net
Tue Sep 12 19:15:41 MDT 2006

Hi all

I'm looking for creative ways to give immediate feedback to Web users  
when their text (entered into a textarea) won't fit in its alotted  
space on its printed form -- without users having to wait for the  
admin to print the form and give it to them -- possibly the next day.

I've got a project where users enter text into a textarea on a web  
page (FX.php).  There is a word-count limit on the field which works  
fine *technically* (i.e. users cannot submit text over the limit).   
The text in this field is later printed from FileMaker client by an  
admin.  The field prints on a form and has pre-defined dimensions of  
approx 2.5" x 4". The problem is that users want to be able to enter  
their text differently, e.g. some as a paragraph, some as a list,  
some with blank lines, etc, so a word-count doesn't really make that  
much difference (e.g. 5 words in a list can take up as much physical  
space as 20 words in a paragraph).  And getting all users to only  
enter text in one way (e.g. paragraphs only, no lists) is not an  
option at this time.  (We'd originally used a character count, but  
they preferred word-count)

One other complication is that some reports are printed in OS X, and  
some in Windows XP, so even there there is a discrepancy between how  
much text will fit into this text box -- however I'd be happy to  
display at least an *approximation* of what the printed form will  
look like.

I've been playing with creating a PDF (via FPDF) to display just this  
text field within a bordered rectangle.  This seems to work _OK_, but  
it's certainly not ideal -- opening a new browser window and/or a PDF- 
reader app window, with a message to close the window to continue  
editing.  I don't like how it interrupts the UI of: (1) select record  
to edit; (2) edit record; (3) click to submit changes.  It would be  
an additional step (2a) to optionally(?) view an approximation of how  
the field will print, and then (2b) to close that window and continue  
editing before submitting (step 3).

If I could display this in just a small pop-up window, it would be  
more acceptable, but that doesn't seem possible since as a PDF it  
could open up either in the browser or in a PDF-reader app.  And I  
don't want to put the whole form into a PHP-generated PDF, as it's a  
large, 2-sided report with very tight text-formatting (and I'm lazy).

Then I thought of maybe creating an image (GD) with the text inside  
the sized rectangle -- which probably *could* display in a small pop- 
up window -- but before I tackle that one, I thought I'd ask for  

Anybody got any for me?

(And if I use a PDF or an image, how consistent will these be for  
users on different browsers, different platforms, etc.?)


More information about the FX.php_List mailing list