使用自定义界面将pdf嵌入到html5页面中,仍然很容易操作 [英] Embedding pdf into html5 pages with a customed interface, still being interractable

查看:335
本文介绍了使用自定义界面将pdf嵌入到html5页面中,仍然很容易操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我需要一种将.pdf简单地实现为html5页面的方法.不幸的是,,等会导致凌乱且不切实际的pdf. (而且很丑).

So, I need a way to simply implement .pdf into html5 pages. Unfortunatly, , , etc. renders messy and unpractical pdf. (And it's ugly).

我尝试使用pdf.js,但对于我打算做的事情来说,它似乎太大了,也太沉重了.另外,缺乏文档使正确实施非常困难.

I tried to use pdf.js, but it seems too big, and too heavy for what I intend to do. Plus, the lack of documentation makes it very hard to implement correctly.

我需要的是:

  1. 一次显示一个pdf页面的方式(这意味着无法滚动).
  2. 由于pdf.js似乎将每个pdf页面变成一张图片,因此如果pdf变得模糊,就无法放大它.我想要的是缩放以相应地更新到缩放级别.
  3. 文本必须是可选的,可以搜索单词,等等.
  4. 没有可打印的难看菜单.
  5. 为了能够访问正在查看的页码,因此我可以创建下一页"和上一页"按钮.

那么,我应该继续尝试设置pdf.js,还是上面列出的一种更好,更轻松的方法来做我需要做的事情?

So, should I keep trying to set up pdf.js, or is there a better, easier option to do what I need to do, listed above?

推荐答案

我建议您遵循以下准则启动软件(以免使用PDF.js ...这很复杂且非常慢).您的软件会快速且跨平台的性能独立

I suggest you to bringup your software following these guidelines (in order to NOT use PDF.js...it is complex and very slow).Your software will be fast and cross-platform performance indipendent

  1. 创建一个读取输入参数(本地文件系统上的文件名)的页面
  2. 将要查看的PDF传递到页面上
  3. 在服务器端,读取文件并转换为svg(每页1个).我可以建议您 pdf2svg https://github.com/dawbarton/pdf2svg
  4. 同一页面必须输出一个HTML页面,其中包含创建的SVG图像,这些图像使用您想要的CSS规则进行格式化
  1. Create a page that read an input parameter (filename on local filesystem)
  2. Pass to the page the PDF you want to view
  3. On server side, read the file and convert to svg (1 per page). I can suggest you pdf2svg https://github.com/dawbarton/pdf2svg
  4. The same page has to output an HTML page containing the created SVG images formatted with you CSS rules like you want

最后,您可以开始使用工具栏,功能等了.

Finally, you can start to work on toolbar,functionality, etc...

这篇关于使用自定义界面将pdf嵌入到html5页面中,仍然很容易操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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