View Single Post
Old 12-26-2022, 10:19 AM   #1
Lafisrap
Junior Member
Lafisrap began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jul 2020
Device: Kindle Reader
Question TypeError: can only concatenate str (not "bytes") to str when using extraCss and TOC

When I call
Code:
ebook-convert tmp.md tmp.pdf --extra-css tmp.css --pdf-add-toc --level1-toc "//h:h1"
with a source file
Code:
# Headline

Text
I get this error:
Code:
Traceback (most recent call last):
  File "runpy.py", line 196, in _run_module_as_main
  File "runpy.py", line 86, in _run_code
  File "site.py", line 47, in <module>
  File "site.py", line 43, in main
  File "calibre/ebooks/conversion/cli.py", line 419, in main
  File "calibre/ebooks/conversion/plumber.py", line 1281, in run
  File "calibre/ebooks/conversion/plugins/pdf_output.py", line 183, in convert
  File "calibre/ebooks/conversion/plugins/pdf_output.py", line 249, in convert_text
  File "calibre/ebooks/pdf/html_writer.py", line 1163, in convert
  File "calibre/ebooks/pdf/html_writer.py", line 757, in add_pagenum_toc
TypeError: can only concatenate str (not "bytes") to str
If I leave out any of the three -- options, the command is successful. If I don't use # Title then also. It also works fine with epub.

My Calibre version is 6.10, system ist Ubuntu 22.4, fresh install.

What can I do to use extra css and a TOC together?
Lafisrap is offline   Reply With Quote