Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

My requirement is to print a page as it looks on the screen.

On my page has a DIV with vertical scroll. I scroll it to a portion which I want to see in a print along with other content on the page.

I use browser printing and invoke the print preview from the file menu. But sadly my div scroll is back up to top and it is not where my scroll was on the original page.

Is this a bug in IE or is there any work around for this?

Thanks,

Vj
Posted

1 solution

Have a look into CSS Media Types - W3Schools Media Types - use CSS specifically for a print layout of your site. This allows you to customise the printout of your site without changing the look of the site in the browser. In your case you will have to change your CSS until you get it to print out as it looks on the screen. Remember, if you have a fluid (dynamic) layout (which you should and if you don't I highly recommend you change now! It's very annoying not having sites fill my whole screen!), if you have a fluid layout, then on large screens more text will be shown than on 800x600 screens but your printout will (almost always) be on A4 paper - in other words for different users the printout and screen versions will not look exactly the same. This is not a problem, just make sure your CSS makes it easy to print on A4 paper, regardless of scren size. Your Print Media CSS should use fixed widths to achieve this.
Hope this helps,

Ed :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900