hexo框架下博客页面嵌入PDF文件预览

PDF预览

由于文件挂载到GitHub上的可能访问有点慢

test.pdf    

方法 1

嵌入代码

{% pdf https://uerlink.cn/files/pdf/test.pdf %}   

注意

  1. 需要在博客根目录中使用git bash或power shell 安装插件
$ npm install --save hexo-pdf
  1. 此方法下这个test.pdf在需要外部路径,不能使用/file/pdf/test.pdf

方法 2

嵌入代码

<div>
<embed src="/files/pdf/test.pdf" type="application/pdf" width="100%" height="100%">
</div>

方法 3

嵌入代码

<iframe src="/files/pdf/test.pdf" width="100%" height="100%"> This browser does not support PDFs. Please download the PDF to view it: <a href="/index.pdf">Download PDF</a> </iframe>