最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How To disable Print Preview feature of Chrome browser using Javascript or c# - Stack Overflow

programmeradmin1浏览0评论

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.

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.

Share Improve this question edited Aug 20, 2015 at 11:16 Pete 58.5k29 gold badges130 silver badges184 bronze badges asked Aug 18, 2015 at 7:48 user2078643user2078643 952 gold badges2 silver badges12 bronze badges 4
  • Your question isn't very clear in chrome it shows print preview could you clarify? – NibblyPig Commented Aug 18, 2015 at 7: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 Commented Aug 18, 2015 at 8: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 Commented Aug 18, 2015 at 10:54
  • Possible duplicate of Disable print preview in Chrome – CubeJockey Commented Oct 5, 2015 at 17:14
Add a ment  | 

1 Answer 1

Reset to default 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 mand 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 mand line "--kiosk-printing". This will quick print, so to speak, to the puters 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.

发布评论

评论列表(0)

  1. 暂无评论