Is there any CLI tool, that can convert a (Mobipocket eBook) PRC file to a PDF?

I Googled on it but all I found was about converting doc(x)/HTML/series of images to pdf.

  • First thing that comes to mind is using calibre via command line, though I haven't tried this myself. PRC/EPUB/AZW is basically a bunch of HTML files in a compressed archieve, so you do need to render this HTML somehow. – dirkt Sep 24 '17 at 6:18
  • I tried Calibre but the problem with it was it couldn't be installed without GUI which I don't need since I don't have X11 installed on my home server. If there's no other option, I will install Calibre on my Windows PC and not on my server. – Weylyn Savan Sep 26 '17 at 7:12

I just tested ebook-convert from Calibre, and it runs completely without X11 from the commandline. Of course the package as a whole depends on X11 and other GUI libraries. If you don't want to install those (or if you don't want to use dpkg --force-depends -i ..., and then manually sort out what you still need), the only way is to get the source, figure out what parts you need, and install those.

There's also wkhtmltopdf, but again this relies on Qt libraries to do the rendering, and I'm nor sure how well it works with ebooks: I didn't try, and you'll have to unpack the PRC file first.

If you want to render graphics (and converting HTML into a PDF means you have to render graphics, you need to do glyph positioning) some kind of graphics libraries are unavoidable ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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