HTML 显示 PDF 文件的几种方式

HTML PDF About 831 words

object 标签

data属性中配置PDF文件路径,type选择application/pdf

<html>
<head>
    <title>Object PDF</title>
</head>
<body>
<object data="https://www.mahailushu.com/pdfjs/web/mine.pdf" type="application/pdf" width=1000 height=800></object>
</body>
</html>

embed 标签

<html>
<head>
    <title>Embed PDF</title>
</head>
<body>
<embed src="https://www.mahailushu.com/pdfjs/web/mine.pdf" type="application/pdf" width=1000 height=800>
</body>
</html>

iframe 标签

<html>
<head>
    <title>Object PDF</title>
</head>
<body>
<iframe src="https://www.mahailushu.com/pdfjs/web/mine.pdf" width=1000 height=800></iframe>
</body>
</html>

其他方式

pdf.js开源方法。

https://github.com/mozilla/pdf.js

Views: 1,758 · Posted: 2023-09-19

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh