Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 06-22-2025, 06:34 PM   #1
JollyRachele
Junior Member
JollyRachele began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jun 2025
Device: None
Unhappy Help with converting epub with greek characters to pdf

I was using calibre's awesome CLI to make this script to generate PDF files out of a few dictionaries I needed (unfortunately I need to use the PDF file format to import them in Zotero, a popular cross-platform annotation tool).

Code:
p="$HOME/Downloads/tmp/"
mkdir $p; cd $p
#rm -rf *
list="
https://archive.org/details/anelementarylat01lewigoog/page/58/mode/2up?ref=ol&view=theater
https://archive.org/details/latindictionaryf00andr?ref=ol&view=theater
https://archive.org/details/intermediategree00lidd?ref=ol&view=theater
https://archive.org/details/homericdictionar00auteiala?ref=ol&view=theater
"


for i in $list; do
  echo $i | grep -o -P "https://[^)]*" | grep -o -P "/details/[^?\/]*" | sed -e 's/^\/details\///' | xargs -I {} wget "https://archive.org/download/{}/{}.epub" # | grep -o -P "\(https://.*?\)"
done

for i in ./*.epub; do #w x for i in "*.epub"; do
  ebook-convert $i $i.pdf #--txt-output-formatting plain #--txt-output-encoding utf-32 # --embed-all-fonts
  #pandoc $i -f epub -t pdf -s -o "$i.pdf"
done
You may try this out yourself if you wish: I think it only downloads 3/4 of the epub files, but that's just because one of the epub files is 'temporarily unavailable' on archive.org.

Unfortunately what happens in the end is that the PDF doesn't have proper greek characters, but seems to reproduce the UTF-8 format, part of the XHTML of the starting epub!

It's strange as Calibre's GUI previews everything fine...
Any ideas?

Thank you so much in advance!
JollyRachele is offline   Reply With Quote
Old 06-22-2025, 10:06 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: 45,307
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
post a link to an actual epub file causing issues.
kovidgoyal is offline   Reply With Quote
Old 06-23-2025, 03:26 AM   #3
JollyRachele
Junior Member
JollyRachele began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jun 2025
Device: None
Link

Sure, here is one with the greek characters: https://ia902203.us.archive.org/2/it...ree00lidd.epub
JollyRachele is offline   Reply With Quote
Old 06-23-2025, 05:27 AM   #4
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: 45,307
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Converted fine for me, see attached, with

ebook-convert file.epub .pdf
Attached Files
File Type: pdf intermediategree00lidd.pdf (11.64 MB, 3 views)
kovidgoyal is offline   Reply With Quote
Old 06-23-2025, 10:32 AM   #5
JollyRachele
Junior Member
JollyRachele began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jun 2025
Device: None
Interesting, your
Code:
.pdf
argument actually made it work properly, instead of me specifying the file name as the
Code:
epub
file with the
Code:
.pdf
option appended to it.

Well done, problem solved
JollyRachele is offline   Reply With Quote
Reply

Tags
conversion, encoding, epub, greek, pdf


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
When converting AZW3 to PDF, the resulting book shows gibberish characters. luigi rovatti Conversion 1 10-01-2021 03:59 PM
Fonts with Greek characters pbw Conversion 4 02-13-2012 06:07 PM
Spanish characters dissapear after converting to EPUB zephyrot Calibre 7 11-28-2010 03:37 PM
after converting to epub, it shows as strange characters? mhmohamadi Calibre 1 05-23-2010 03:03 PM
Converting PDF to MOBI, weird characters in story cloudyvisions Calibre 12 05-23-2009 11:45 AM


All times are GMT -4. The time now is 04:24 PM.


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