GitbookIO / gitbook-cli

GitBook's command line interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gitbook pdf throw exception

mistbor opened this issue · comments

$ gitbook -V
CLI version: 2.3.2
GitBook version: 2.6.7

Celebre has been installed.

$ gitbook pdf ./ a.pdf
(node:14312) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:14312) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
info: loading book configuration....OK
info: load plugin gitbook-plugin-highlight ....OK
info: load plugin gitbook-plugin-search ....OK
info: load plugin gitbook-plugin-sharing ....OK
info: load plugin gitbook-plugin-fontsettings ....OK
info: >> 4 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: ebook-convert C:\Users\YFZX-M1\AppData\Local\Temp\tmp-14312iwvff65.snu92j4i\SUMMARY.html C:\Users\YFZX-M1\AppData\Local\Temp\tmp-14312iwvff65.snu92j4i \index.pdf --title="Introduction" --comments="" --language="en" --book-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="descendan t-or-self::[contains(concat(' ', normalize-space(@Class), ' '), ' book-chapter-2 ')]" --level3-toc="descendant-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" --margin-bottom="56" --pdf-default-font-size="12" --pdf-mono-font-size="12" --paper-size="a4" --pdf-header-template="
<body style="color: #000; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: sans-serif;">
<div class="pdf-header" style="margin-top: 20px; color: #aaa; padding-bottom: 10px; border-bottom: 1px solid #eee;">
TITLE

" --pdf-footer-template="
_SECTION_ _PAGENUM_
" --pdf-sans-family="Arial" F:\calibre\calibre_install\app\pylib.zip\dateutil\parser.py:601: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as be ing unequal Traceback (most recent call last): File "site.py", line 101, in main File "site.py", line 78, in run_entry_point File "site-packages\calibre\ebooks\conversion\cli.py", line 395, in main File "site-packages\calibre\ebooks\conversion\plumber.py", line 1271, in run File "site-packages\calibre\ebooks\conversion\plugins\pdf_output.py", line 196, in convert File "site-packages\calibre\ebooks\conversion\plugins\pdf_output.py", line 282, in convert_text File "site-packages\calibre\ebooks\conversion\plugins\pdf_output.py", line 308, in write File "site-packages\calibre\ebooks\pdf\render\from_html.py", line 255, in dump Exception: PDF Output failed, see log for details Conversion options changed from defaults: title: u'Introduction' book_producer: u'GitBook' max_levels: 1.0 level3_toc: u"descendant-or-self::*[contains(concat(' ', normalize-space(@Class), ' '), ' book-chapter-3 ')]" pdf_mono_font_size: 12.0 margin_top: 56.0 breadth_first: True no_chapters_in_toc: True margin_bottom: 56.0 pdf_header_template: u'' level1_toc: u"descendant-or-self::*[contains(concat(' ', normalize-space(@Class), ' '), ' book-chapter-1 ')]" language: u'en' page_breaks_before: u'/' margin_left: 62.0 paper_size: u'a4' pdf_default_font_size: 12.0 level2_toc: u"descendant-or-self::*[contains(concat(' ', normalize-space(@Class), ' '), ' book-chapter-2 ')]" chapter: u"descendant-or-self::*[contains(concat(' ', normalize-space(@Class), ' '), ' book-chapter ')]" publisher: u'GitBook' margin_right: 62.0 1% ������ת��ΪHTML��... InputFormatPlugin: HTML Input running on C:\Users\YFZX-M~1\AppData\Local\Temp\tmp-14312iwvff65.snu92j4i\SUMMARY.html Creator not specified Building file list... Normalizing filename cases Rewriting HTML links 34% ���ڶԵ���������ת��... Merging user specified metadata... Detecting structure... Detected chapter: Introduction Detected chapter: test01 Detected chapter: test02 Auto generated TOC with 3 entries. Flattening CSS and remapping font sizes... Source base font size is 12.00000pt Removing fake margins... Cleaning up manifest... Trimming unused files from manifest... Creating PDF Output... 67% �������� PDF Output ���� Splitting markup on page breaks and flow limits, if any... 75% Rendered SUMMARY.html 83% Rendered index.html 91% Rendered test01.html 100% Rendered test02.html Traceback (most recent call last): File "site-packages\calibre\ebooks\pdf\render\engine.py", line 157, in end File "site-packages\calibre\ebooks\pdf\render\serialize.py", line 518, in end File "site-packages\calibre\ebooks\pdf\render\fonts.py", line 255, in embed_fonts File "site-packages\calibre\ebooks\pdf\render\fonts.py", line 174, in embed File "site-packages\calibre\ebooks\pdf\render\fonts.py", line 196, in write_to_unicode File "site-packages\calibre\ebooks\pdf\render\fonts.py", line 105, in __init__ File "site-packages\calibre\ebooks\pdf\render\fonts.py", line 65, in to_hex_string TypeError: rjust() argument 2 must be char, not unicode

Python function terminated unexpectedly
PDF Output failed, see log for details (Error Code: 1)