Chrome 77无法自动打印PDF [英] Chrome 77 Not Auto-Printing PDFs
问题描述
Chrome 77已停止尊重PDF中的 print()
嵌入式JS,以便在加载PDF后启动/打开打印对话框.
Chrome 77 has stopped respecting the print()
embedded JS in PDFs to initiate/open the print dialog after a PDF has been loaded.
例如,在Firefox,Chrome 76或Acrobat中打开以下文件,您会看到出现打印对话框.在Chrome 77中不再显示.具体来说,在我的情况下以及在其他三台计算机上,我都在版本77.0.3865.75上对此进行了测试.
For example, open the below file in Firefox, Chrome 76, or in Acrobat and you'll see the print dialog appear. In Chrome 77 it is no longer appearing. Specifically, in my case and on three other computers I tested this on, version 77.0.3865.75.
https://cdn.dealrcloud.com/assets/test/Invoice-1003.pdf
这是我们可以调整/修改的新设置,还是一项永久性的重大更改,将阻止我们为Chrome客户端自动触发打印对话框?
Is this a new setting we can adjust/modify or is this a permanent breaking change that will prevent us from auto-triggering a print dialog for Chrome clients?
推荐答案
此内容已被故意删除.
仅在响应用户手势时才允许print()
Allow print() only in response to a user gesture
https://pdfium.googlesource.com/pdfium.git/+/2021804f1b414c97667c03d7ab19daf66f6
问题是PDF文件中的嵌入式JavaScript不遵守嵌入页面的Content-Security-Policy. https://crbug.com/968914
The issue was that the embedded JavaScript in PDF files did not respect the Content-Security-Policy of the embedding page. https://crbug.com/968914
这篇关于Chrome 77无法自动打印PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!