E-mail List Archives

Re: Textarea content cropped when printed


From: Jukka K. Korpela
Date: Nov 23, 2010 9:03AM

steven wrote:

> I've been trawling the web and I have yet to find a workable solution
> for stopping textarea (or input) field content from being cropped
> when printed, if the content itself is larger than the allotted field.

There is no satisfactory way to guarantee that all of the contents of a form
get printed. Forms aren't really suitable for printing. You can use CSS to
suggest larger width and height for a textarea or input field on print, e.g.
@media print { textarea { width: 100%; height: 20em; } }
but setting the height is really guesswork and may still result in
truncation (or excessive amount of empty space).

The best approach is to make the server-side form handler echo back the data
it gets, so that the user can then conveniently print or save that data.
This is useful for many reasons - people often want a record of what they
have sent. It might be a good idea to say on the form page, probably at the
end, something like "When you have submitted the data, you will get a page
containing all the data. You can then save or print it for your reference."
Otherwise people may try to print the page in vain, getting truncated texts

(Replace "submitted the data" by something that describes what the form
really is for, like "sent your application".)

Yucca, http://www.cs.tut.fi/~jkorpela/