开发者

Print silently in Chrome

I need to be able to print silently in Chrome. In my ticket system no prin开发者_运维百科t dialog can appear, I just wont it to print on my javascript command.

I've done this before in Firefox but now I will change to Chrome as browser.

There is a ticket on this: https://code.google.com/p/chromium/issues/detail?id=31395#c4

Comment #4 says:

If --kiosk is specified and the preference printing/printer/default is specified, the print dialog will be skipped.

I have set kiosk mode but dont know where to change the preference printing/printer/default he is talking about? At least it does not exists in my version of Chrome (14.0.835.35 dev-m). But I have a default printer in windows.


For silent printing, you must start Chrome with the --kiosk AND --kiosk-printing flags. This will cause Chrome to display but immediately close the print dialog upon the user attempting to print the page or javascript executing window.print().

Because the print dialog will no longer be available, the printing will automatically use the settings that were last selected in Chrome (or the system default).


The issue you linked to isn't resolved - it is marked as "Available" meaning that it is waiting for some developer to work on it. "printing/printer/default" preference is merely a suggestion for how this feature should be implemented. Comment 4 is about merging a similar issue, not about the actual implementation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜