在我的博客中插入我的pdf [英] Inserting my pdf in my blogs

查看:103
本文介绍了在我的博客中插入我的pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个帖子页面,其中存储了每个单独的博客.每个博客都有一个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆