I am using pandoc to create EPUB files from markdown files to read the EPUB on my Kobo. It works well except with the cover which is not displayed at the proper size.

Here is the cover image:

enter image description here

Here is the result:

photo of the EPUB displayed on my Kobo

Here is the command I use to create the book:

pandoc first.md second.md --epub-cover-image=cover.png -o ebook.epub

The cover image dimensions are: width: 1600 px; height: 2400 px following recommendations here:


But size is still weird with other dimensions. I wish it would auto-resize.

Any idea how to fix it ?

1 Answer 1


Unless I am mistaken I hacked a fix for this at some point by (1) unzipping the epub and (2) running a sed one-liner that edited the html to embed the image in an adhoc <svg> tag so it automatically resized to the size of the screen and (3) zipped back the epub. Doesn't matter any more in any case because shortly afterwards I opened a ticket with pandoc-discuss asking the developers to add this enhancement to pandoc's next release … Which they did! Since this was over a year ago IIRC… current stable pandoc release should have it…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.