Unable to print PDF file in Edge browser

不打扰是莪最后的温柔 提交于 2019-12-24 06:44:41

问题


Trying to print PDF file retrieved from server.

Approach 1

  • Retrieve PDF from server via AJAX
  • Create Blob (URL.createObjectURL(pdfFile))
  • Set blob ObjectUrl as a source to iframe
  • Print iframe (iframeContentWindow.document.execCommand('print', false, null))

Problem

Not working in Edge since it has issue link1, link2, link3

Approach 2

  • Set URL from which server returns PDF as a source to iframe
  • Print iframe

Problem

Endpoint which returns PDF requires authorization, as i see there is no way to pass authorization information, so iframe fails to load with 401 Unauthorized.

How can i print PDF file retrieved from server in Edge ?

Server side - ASP.NET Core

来源:https://stackoverflow.com/questions/49506664/unable-to-print-pdf-file-in-edge-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!