Is it necessary to use pdf.js in the project?

studied pdf.js

for half a day.

the cross-domain problem has not been solved. Later, it was found that all mainstream browsers can directly open pdf files and provide functions such as downloading / printing

.

so, is it necessary to use pdf.js or other pdf plug-ins in your project?

and after I pass the pdf file as a path to the iframe tag, the pdf file is displayed

.

clipboard.png

html


js


clipboard.png

find a solution!

Mar.13,2021

whether it depends on your needs, it's hard to say without them.

as for the fact that iframe, hasn't been used for a long time, try specifying a fixed size.

Menu