在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