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
了。