views:

333

answers:

2

I would like to print scrollable div as WYSWYG. Is there a way?

A: 

Not with pure css, I don't think. My...interpretation of what happens when you hit the print button is that the document's reloaded with either the media="print" or other relevant stylesheet, and then sent to print-preview/the printer as a new document, with all content in the default/start position as defined in that stylesheet.

Since I can't think of a way to position the scrolling content, using css, I'd have to say that it's not possible. Javascript's almost certainly the way to go on this one.

...may I ask why you'd want to do this? It's not a criticism, I just...don't understand.

David Thomas
fine, I would like to print snapshot of the page.
afin
Then, see comment below, I think 'Prnt Scrn' would be your bestest (albeit kludgy) friend. I believe JS *can* take screengrabs, I just don't know JS well enough to advise, sorry. =(
David Thomas
+1  A: 

I don't think you can do it even with javascript. It is against the spirit of the web. Printed document is supposed to look different.

I suspect that when you see a scroll bars on printed page, it is a bug to be fixed in future version of a browser.

buti-oxa
Is that what he meant? Ahh...I assumed he meant that he wanted to scroll an overflow-ed div and then print the page with that div at the scrolled-position. If your interpretation is right (and it makes far more sense than mine did), I can see why he'd want it. Perhaps for printing out page design-drafts, or something?...think perhaps the old faithful <kbd>Print Screen</kbd> would be of most use.
David Thomas