gitbook convert pdf error in windows

Issue

按gitbook文档安装了gitbook及bitbook-pdf,但转换总是不成功,错误:

info: loading book configuration....OK
info: load plugin gitbook-plugin-highlight ....OK
info: >> 1 plugins loaded
info: start generation with pdf generator
info: clean pdf generatorOK
info: write SUMMARY.html
info: start conversion to pdf ....ERROR

Error: Command failed: C:\Windows\system32\cmd.exe /s /c "ebook-convert C:\Users\i\AppData\Local\Temp\tmp-11100pk4gam8\SUMMARY.htm
l C:\Users\i\AppData\Local\Temp\tmp-11100pk4gam8\index.pdf --title="数据运营平台 高层设计" --comments="//TODO" --language="en" --b
ook-producer="GitBook" --publisher="GitBook" --chapter="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '),
' book-chapter ')]" --level1-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-1 ')]"
--level2-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-2 ')]" --level3-toc="descen
dant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-3 ')]" --no-chapters-in-toc --max-levels="1" --
breadth-first --chapter-mark="pagebreak" --page-breaks-before="/" --margin-left="62" --margin-right="62" --margin-top="56" --margi
n-bottom="56" --pdf-default-font-size="12" --pdf-mono-font-size="12" --paper-size="a4" --pdf-header-template="<p class='header'><s
pan>数据运营平台 高层设计</span></p>" --pdf-footer-template="<p class='footer'><span>_SECTION_</span> <span style='float:right;'>_
PAGENUM_</span></p>""
'ebook-convert'                            e

Solution

原因是ebook-convert找不到,虽然npm info ebook-convert显示的ebook-convert是存在的,官方文档也没说需要特别处理:persevere: 看起来npm包上的ebook-convert应该只是nodejs适配包,并不包含真正的执行程序。

解决方法很简单,安装calibre http://www.calibre-ebook.com/download_windows , 安装后就有 ebook-device.exe 了。

转载于:https://my.oschina.net/gudaoxuri/blog/515359

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值