1

I have page which contains textArea's. If some of this textArea's contains too many text, user can't see all text (only if use scroll).

So i add js-function to make textArea height fit text inside :

window.addEventListener('resize', function(event) {
        $('textarea').each(function() {
            resizeTextArea(this);
        });
    });

But when i use window.print(); this behaviour doesn't apllied to textArea's. So i have idea to add some eventListener to print event, but my researching show that there are only some listeners for some browsers like IE or FireFox.

So is there any other solution that could help me print textArea's with fully visible text inside?

How textArea looks in print-window :

print-image

How textArea looks on page which is used for print :

enter image description here

demo
  • 6,038
  • 19
  • 75
  • 149
  • 1
    When you're calling `window.print();` yourself - why don't you also call `resizeTextArea()` beforehand? – maja May 08 '15 at 12:22
  • @maja, do you mean on document.ready? I try to do it, but i understand that print window takes height of textArea that are at the page (if i make screen size less on page from where print is applied, then height of textArea would be perfect) – demo May 08 '15 at 12:27
  • Perhaps you have a link demonstrating the problem? – levi May 08 '15 at 12:54
  • Duplicate of http://stackoverflow.com/questions/4435906/print-when-textarea-has-overflow – Stephen Thomas May 08 '15 at 12:56
  • @levi, with this can be problems... – demo May 08 '15 at 13:27
  • @StephenThomas, thanks, i will try to implement it. Just one problem - all textarea's are generated from server side, it can make some troubles – demo May 08 '15 at 13:27
  • http://stackoverflow.com/a/24996182/3917754 this answer seems to work... but need to check in all Browsers – demo May 08 '15 at 14:47

0 Answers0