简体   繁体   English

在Ruby和Rails中阅读PDF,DJVU格式

[英]Reading PDF, DJVU formats in Ruby and Rails

What is the best way to work with PDF and DJVU formats in Ruby/Ruby On Rails? 在Ruby / Ruby On Rails中处理PDF和DJVU格式的最佳方法是什么? What I need is to get number of pages and get picture of the specific page. 我需要的是获取页数并获取特定页面的图片。 There are will be more cases in future. 将来会有更多的案例。

Now, I'm using command promt for this (djvulibre for DJVU, gs for PDF). 现在,我为此使用命令提示符(DJVU为djvulibre,PDF为gs)。 It works fine, but if there is a more preferable tool? 它工作正常,但是是否有更理想的工具?

The Prawn Ruby gem should do you and Djvu-tools is the only one I have heard of for djvu files. Prawn Ruby gem应该可以帮助您, Djvu-tools是我听说过的唯一djvu文件的工具。

Also, some other interesting pdf options include rails-latex a nifty little framework for latex files in a rails server. 另外,其他一些有趣的pdf选项包括rails-latex ,它是Rails服务器中用于乳胶文件的漂亮小框架。 Latex includes some very interesting libraries such as TikZ/Pgf that produce beautiful documents difficult to match in html . Latex包含一些非常有趣的库,例如TikZ / Pgf ,它们可以生成漂亮的文档,而这些文档很难在html匹配。

the ruby-poppler bindings can render a PDF to JPG. ruby-poppler绑定可以将PDF呈现为JPG。 See my answer in [1] for some sample code. 请参阅我在[1]中的答案以获取一些示例代码。

[1] In Ruby Search PDF, highlight text found, export JPG of the page [1] 在Ruby Search PDF中,突出显示找到的文本,导出页面的JPG

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM