Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加入pdf.js的支持?[solved] #442

Closed
3 of 11 tasks
bethandtownes opened this issue Oct 15, 2018 · 7 comments
Closed
3 of 11 tasks

加入pdf.js的支持?[solved] #442

bethandtownes opened this issue Oct 15, 2018 · 7 comments

Comments

@bethandtownes
Copy link

bethandtownes commented Oct 15, 2018

请问怎么把pdf.js做到next 主题里呢?我想用pdf.js内嵌pdf 然后通过iframe 展示出来。

I agree and want to create new issue


Expected behavior

Actual behavior

Steps to reproduce the behavior

  1. N/A
  2. N/A
  3. N/A
  • Link to demo site with this issue: N/A
  • Link(s) to source code or any usefull link(s): N/A

Node.js and NPM Information


Package dependencies Information


Hexo Information

Hexo version


Hexo Configuration

NexT Information

NexT Version:

  • Latest Master branch
  • Latest Release version
  • Old version

NexT Scheme:

  • All schemes
  • Muse
  • Mist
  • Pisces
  • Gemini

NexT Configuration:

Other Information

@stevenjoezhang
Copy link
Contributor

你准备怎样在Markdown文件中指明pdf文件的URL?是否类似于mathjax,先识别文件头的pdfjs: true,然后可以通过类似于

[sample.pdf](/path/to/sample.pdf)

的方式,识别出链接文件以pdf为拓展名,就自动加载?
还有一个问题是,pdf.js可能会有跨域问题。
以及可以使用PDFObject+pdf.js,参考这篇文章

@maple3142
Copy link
Contributor

maple3142 commented Nov 6, 2018

You can include html in your markdown file:

<div id="pdf-container"></div>
<script src="/js/pdfobject.js"></script>
<script>PDFObject.embed('/yourpdf.pdf', '#pdf-container');</script>**

But why don't you simply use embed or iframe? Most of browsers support loading pdf without js.
https://pdfobject.com/static/

@stevenjoezhang
Copy link
Contributor

@maple3142 It's not working on Safari for iOS, even the newest version. PDF.JS is still required for some browsers on mobile platform.

@maple3142
Copy link
Contributor

Since markdown can contain html, you can add your own js library just like adding a library on a normal html page.

@ivan-nginx
Copy link
Member

Feature added in #466.

@ivan-nginx ivan-nginx changed the title 加入pdf.js的支持? 加入pdf.js的支持?[solved] Mar 4, 2019
@stevenjoezhang
Copy link
Contributor

@jasonsun0310 Usage of new pdf tag: https://theme-next.org/docs/tag-plugins/pdf/

@lock
Copy link

lock bot commented Mar 10, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants