Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
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
Old 12-26-2022, 10:13 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...df2d85756cdd86
kovidgoyal is offline   Reply With Quote
Reply

Tags
css, ebook-convert, pdf, toc


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Can't use string pattern on bytes like object" on Sigil 0.8.7 hantsaniala Sigil 5 02-22-2019 09:36 AM
Help with error: TypeError: cannot concatenate 'str' and 'int' objects Talayero Devices 3 01-24-2013 10:28 PM
Touch Nook STR stuck on "Rooted Forever" screen rosy621 Nook Developer's Corner 18 01-29-2012 06:16 AM
Touch Does Nook STR have something like "hand tool" for reading PDFs? AEA64 Barnes & Noble NOOK 6 12-24-2011 07:14 AM
Touch How good is the "rooted" Nook STR at reading "technical" PDFs? ibex333 Nook Developer's Corner 15 11-19-2011 11:16 PM


All times are GMT -4. The time now is 08:18 AM.


MobileRead.com is a privately owned, operated and funded community.