2

I have created an iframe for printing but in chrome it shows print preview and in other browsers it does not show any print preview dialog. So please suggest to me how to disable print preview in chrome.

I have searched this a lot on google but did not find any fix.

Pete
  • 57,112
  • 28
  • 117
  • 166
user2078643
  • 95
  • 1
  • 2
  • 12
  • Your question isn't very clear `in chrome it shows print preview` could you clarify? – NibblyPig Aug 18 '15 at 07:49
  • I want to disable it.. I don't want any print preview. OR Please suggest me the way to detect whether print preview is enable or not in Chrome – user2078643 Aug 18 '15 at 08:08
  • 1
    This is browser behaviour which you can't control. The only thing you can control is how your content looks if the user does choose to print using a print stylesheet. – timothyclifford Aug 18 '15 at 10:54
  • Possible duplicate of [Disable print preview in Chrome](http://stackoverflow.com/questions/30331771/disable-print-preview-in-chrome) – CubeJockey Oct 05 '15 at 17:14

1 Answers1

6

I assume you're using Windows. In older versions of Chrome (version 20 & below):

  • In your browser, navigate to chrome://flags/#print-preview
  • Click disable to prevent the preview window from appearing.

In newer versions of Chrome (currently on version 47), the above option has been removed, so you must do it through the command line:

  • Find the shortcut (the Google Chrome icon) you use to open Google Chrome, right click that and select properties - Note you may need to go to Start Menu -> All apps (windows 8-10) -> Programs -> Quick Launch
  • Add a space, followed by "--disable-print-preview" (without the quotation marks) to the very end of the "Target" textbox, don't remove any of the text that's already there.

Not the most pleasant solutions, but it does work. Hopefully Google will put that option back into the app, as there is cases where it's not practical for it to appear.

If you want to skip both the chrome print preview and windows print preview steps, use the command line "--kiosk-printing". This will quick print, so to speak, to the computers default printer and default settings.

Chrome like to hang around with background tasks so for either of the above options, make sure you relaunch Chrome and restart the machine if necessary.

Neville
  • 413
  • 5
  • 6