使用 Java API 制作 ePub [英] making ePub with Java API

查看:48
本文介绍了使用 Java API 制作 ePub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 ePub 格式比较陌生,但如果我理解得很好,以编程方式从 XHTML 或 PDF 内容开始制作 ePub 可能意味着:

I'm relatively new to ePub format, but if I understand well, to make programmatically an ePub starting from XHTML or PDF content could mean:

  • 选择 HTML 或 XHTML 内容并使用 XHTML 验证器验证它们(或使用 Tydy 清理它们)
  • 选择要插入到 ePub 中的 PDF 文件
  • 创建 XML 清单或 XML 打包文件和 TOC 文件
  • 将整个文件压缩为 .epub 文件
  • 验证 ePub(我在 Google 代码中看到了一些内容)

所以我的问题是是否有某种高级 Java API 来执行这些步骤.当然我可以在 Java 中使用 API for ZIP、XML,但它是否存在更高的工具?

So my question is if there is some sort of high level Java API to do these steps. Sure I can use API for ZIP, XML in Java, but does it exist higher tools?

非常感谢

------ 编辑-------

------ EDIT -------

我开发了一个开源项目来做到这一点!

I've developed an open source project to do that!

http://scribaebookmake.sourceforge.net/

推荐答案

我还没有看到 java epub 工具链;不过,我在 Sigil 上取得了不错的成功.

I haven't seen a java epub toolchain; however, I have been having good success with Sigil.

如果目标是制作 epub,我会试一试 Sigil.在我使用它之前,我是手动滚动我的 epub(通过 ant build.xml 的自动化).

If the goal is to make an epub, I'd give Sigil a go. Before I used it I was rolling my epubs by hand (with the automation of an ant build.xml).

如果目标是制作基于 Java 的 epub 工具链,那么它应该不会太难,这取决于您希望进行多少验证和流水线操作.就我个人而言,我会从编写 epub 查看器开始.

If the goal is to make a java based epub toolchain, then it shouldn't be terribly hard, depending on how much validation and pipelining you wish to do. Personally, I'd start with writing an epub viewer.

就 PDF 部分而言,我只是嵌入了 XHTML.还没有嵌入 PDF 的需要.就 epub 验证而言,如果所有 xml 都是有效的并且在压缩之前没有悬空链接,那么您将拥有一个有效的 epub.

As far as the PDF parts go, I just embed XHTML. Haven't had a need for embedding PDF yet. As far as epub validation goes, if all the xml is valid and there's no dangling links prior to zipping, you're going to have a valid epub.

这篇关于使用 Java API 制作 ePub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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