美文网首页
前端页面上预览pdf

前端页面上预览pdf

作者: 家有饿犬和聋猫 | 来源:发表于2022-08-05 16:45 被阅读0次

1建一个容器
···
<div
ref={historyRef}
className={${styles.reportHis} overflow-auto flex-grow-1 ml-2}
></div>
···
2 渲染数据
···
const historyRef = React.useRef();
historyRef.current.innerHTML =
'<embed width="100%" height="100%" src="' +pdf_url + '" />';
···
3 将PDf展示到页面内

相关文章

网友评论

      本文标题:前端页面上预览pdf

      本文链接:https://www.haomeiwen.com/subject/jkvpwrtx.html