Sandy
Sandy

Reputation: 69

How can i create my own print preview option for all browser

Is there any way to create my own print preview and give all option as given in chrome print preview. Also i want to hide the chrome default print preview dialog through javascript and show my own print preview dialog, because firefox and IE doesn't have this facility that's why i want my own dialog to show.

Thanks, Sandy

Upvotes: 1

Views: 1466

Answers (1)

Shamanth
Shamanth

Reputation: 216

You can have a new pop-up window which looks like a preview of the page you want to print and provide few functionality through java-script as in Chrome.This will work fine in non chrome browsers.

But you cannot hide chrome's print preview functionality via java-script.

So whatever new print preview page you create will look good in most of the browsers, but your custom print preview page will again go through print preview of chrome before printing.

For ex, Suppose you want to print in order confirmation page of an e-commmerce website by showing your custom print preview. To achieve this you can have a dummy print button on the confirmation page on click of which your pop up opens with the formatted print content with extra functionality as provided by chrome. You can have your print button (window.print())in your custom print preview to print the final page.

But this works fine in non chrome browsers, but will go through chrome's preview functionality again.

Upvotes: 2

Related Questions