How does the front end display the file flow on the server side using pdf.js?

The

background interface looks like this http://192.168.96.40:8081/xx/getPdf?keyId=xxx1123, link opens directly in the browser and displays a window for downloading the file:

now the requirement is to preview the file directly on the browser client. I tried to use pdf.js

<iframe src="../test/js/pdfjs/web/viewer.html?file=http://192.168.96.40:8081/xx/getPdf?keyId=xxx1123" width="100%" height="750"></iframe>

it is not possible to preview the pdf file directly. Is there any other way to preview the pdf file stream on the server side on the client side?

Apr.01,2021

pdf.js is not used correctly. Please learn the official document
https://github.com/mozilla/pd.


write a Base64 data stream of PDF returned by the background two days ago, and use pdf.js to preview the demo, of the PDF file. Click the article link below to see
http://www.chenhanpeng.com/PD.


have you solved this problem?

Menu