Print page without opening it.

IS there a way to print a webpage without opening it?  Lets say I'm on a page: and that page is very stylized (CSS) and I have an option on that page to "Print Page"  BUT, I have another version of that page; and this page has been formatted to print out.

I DON'T want to open this page, I want to print it from

Is that possible? Any clues?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
The only file that I know of that you can print without 'opening' it is a plain text file going to a plain text printer (which you probably haven't seen in 10 years anyway).  Everything else, HTML, PDF, 'doc', 'xls' must be opened by the program that can format it properly.  In the case of PHP, you can't even generate the page without opening it in PHP.  Until you open it and run the PHP, the 'printable' version doesn't even exist.
rgranlundAuthor Commented:

I'm using a JQuery Plugin and the following:
            $(document).ready(function() {

<span class="print">PRINT</span>

Open in new window

Is there a way to print a containing DIV instead of the entire page?
Big MontySenior Web Developer / CEO of Commented:
you may be able to do it with ajax and jquery:

the last one, you should be able to load the data into a variable (or hidden div) via ajax, and then use the printElement() call.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave BaldwinFixer of ProblemsCommented:
Is there a way to print a containing DIV instead of the entire page?
There might be but that's not your original question.  And in the case of the DIV, it still has to be on the page in the browser to print it with the correct formatting.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.