Solved

I want to print a page that have a horizontal scroll

Posted on 2013-12-04
4
922 Views
Last Modified: 2013-12-06
Hi,

I want to know how to print whole page that contains a horizontal scroll inside a div,
When I try that , I only prints the part of the screen that is in the view while clicking print !
The rest is n't printed , How to print it ???


sample page is attached.. Try printing it , not all the div is printed .
Note : I want to print the div itself , rest of the page is n't important for me ...
1.html
0
Comment
Question by:darroosh
  • 2
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
Test page : http://fiddle.jshell.net/6xSKq/2/show/
Source : http://jsfiddle.net/6xSKq/2/
    @media print
    {
    	div { display: block;width:2048px !important; }
    }

Open in new window


More infos : http://www.w3.org/TR/CSS2/media.html
0
 

Author Comment

by:darroosh
Comment Utility
Thank you , Good solution ..
I sloved it before  reading your  post by another  way  , posting it as it may help another  one..

When clicking the print button , I create a javascript variable  holding the content of the desired  div ..

Then by JQuery I made diplay:none for the whole page , Then add the content of the variable to the page , So that the page now only containing the desired div with width 100 %
Then print it ...

Then revrese the action back..
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
I prefer my solution :P

Have a nice week-end !
0
 

Author Comment

by:darroosh
Comment Utility
Me too :P

Have a nice day !
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now