在我的博客中插入我的pdf [英] Inserting my pdf in my blogs
问题描述
我有一个帖子页面,其中存储了每个单独的博客.每个博客都有一个pdf文件.我可以通过博客页面上传pdf,但是当我通过帖子上的for循环执行代码-post.file_doucment_path时,它仅显示pdf文件的位置.我是否需要添加单独的js pdf阅读器包才能使其正常工作?干杯.
I have a posts page which stores every individual blog. And each blog has a pdf file. I can upload the pdf via the blog page but when I execute my code through the for-loop on posts - post.file_doucment_path it just shows the pdf file location. Do I need to add a seperate js pdf reader package to get it working? Cheers.
推荐答案
HTML5 <object>
元素可以将PDF嵌入到没有外部库的页面中.
HTML5 <object>
element can embed PDFs in a page without an external library.
<object data="the.pdf" width="1000" height="1000" type='application/pdf'/>
只需使用Jekyll语法将"the.pdf
"替换为您的文件文档路径即可.
Just replace "the.pdf
" with your file document path with Jekyll syntax.
例如
<object data="{{ post.file_document_path }}" width="1000" height="1000" type='application/pdf'/>
这篇关于在我的博客中插入我的pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!