在Javascript
Solution:
To resolve this issue, the following approach is suggested:
Leveraging Blobs and Download Attributes:
By setting the responseType of the XMLHttpRequest object to "blob," the response will被接收为斑点对象。该斑点代表PDF文件。随后,您可以使用CreateObjectUrl方法创建下载链接,以允许用户下载pdf。
Benefits:
This method offers the following advantages:
Compatibility with all major browsers, including IE9, Firefox, Opera, Chrome, and Safari
Avoids the deficiencies encountered with the某些浏览器中的data-uri方法[&& && && && && &&华
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3