I run calibre server on a raspberry pi which allows you to upload files and convert them via the web interface via my phone/tablet. You can even then download the new mobi/azw3 via the kindle browser (although the non JS version on my older paperwhite).
I have found the best tools for this to be the free Kindle Previewer ( https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1003018... ) and Calibre. The Calibre editor is useful for cleaning up messed up EPUB files that don't work in the Kindle Previewer.
Calibre runs great in a container too. As always, the Linuxserver image is great.
The Docker Package on Synology made this very easy when I was new to Docker some years ago, and it hasn’t been touched since the initial install, it just works.
Shameless plug and this is only loosely related: Over the last holiday season I wrote a backend (written in Go and running on App Engine) to convert http url into epub. The frontend is a telegram bot that sends the epub to your reMarkable account directly, but it also has rest api to download the epub file: https://github.com/fishy/url2epub/blob/main/REST.md
I want ePub to FB2. Because FB2 books are rendered with better readable fonts on my PockerBook reader.
I have no problems using Calibre or PanDoc for this task though. Obviously the problem emerges when you want to do the job without installing anything.
Why would you convert an epub to pdf? There is no ebook reader, other than kindles (for which the proper conversion would be to kf8), that can't handle epubs.
On the contrary! Why would you ever keep an epub file around? If somehow an epub file finds its way into my computer, the first thing that I need to do is to convert it to pdf to be able to read it with a reasonable viewer (or print it!). After the convesion, I delete the epub file; I really dislike this format and the associated software.
If you print your ebooks for some reason rather than buy used copies, granted you have to convert to pdf for that.
Why prefer an epub...
They have flowed text, and ebook readers let you customize font and font size so that the book's text adapts to you rather than you adapting to a particular combination of publisher quirks and zoom necessary to fit in a particular device's or app's viewable size.
They're generally smaller files.
And if there's something about the epub you don't like, you can actually fix it.
If a book is available in both PDF and epub formats, it's a reader's prerogative to pick the one they want, and there are specific types of books where PDFs might be preferable. However, if there's no original pdf, what is the objective of converting an epub to pdf in order to read it on a computer? Whatever you think you're accomplishing, I think you're mistaken. You end up with a pdf that looks exactly like how a typical ereader would display the epub. Minus the flowed text and font customizability, and probably with poorer navigation as well.
Converting an epub to a pdf adds nothing, only "fixes" your view to specific settings (font, etc.). You won't get better math typesetting that way, if it was missing in the epub.
Math epubs can be done properly using mathjax; equations can be written in typical TeX notation and rendered into MathML or SVG or various other targets.
Also, modern unicode fonts have good coverage of math symbols, so a lot of abstract math can be written inline without even resorting to mathjax. Algebra, set theory, and things like that.
I think the delay there is the many older ebook readers and apps that have quirks that require workarounds to get mathjax to work. Why bother, when publishers could just render equations to images or SVG and hardcode them? Mathjax just takes that rendering step out of the publishing pipeline.
Text flow... are you talking about inter-word spacing and rivers? My take on that is: full text justification was always a bad idea, only promoted for aesthetic reasons and to show off fancy layout engines that reduced rivers and other bad artifacts. It seems some publishers are doing away with it in new books. Poetry and plays rarely used it.
> Text flow... are you talking about inter-word spacing and rivers? My take on that is: full text justification was always a bad idea, only promoted for aesthetic reasons and to show off fancy layout engines that reduced rivers and other bad artifacts. It seems some publishers are doing away with it in new books.
I would say that mathematicians are extremely picky about the quality of their displayed formulas. Most of what can be produced by mathjax is not of acceptable quality. I speak about fine-tuning of kerning, alignement, etc. Having "reflowable" text is a nightmare for typography-inclined people: the flow is an essential part of the content and you do not want to lose it!
Everyone prefers better typography, but what qualifies as readable and acceptable for math? Generations of mathematicians learned from handwritten (including horrible scribbles on chalkboards), typewritten, and facsimile/photocopied material (like many Dover reprints). Current mathematicians grab scans of old math books from online pirate libraries. Math material on the web is mostly mathjax, and it's just fine. Math rendering doesn't have to be up to Spivak's standards to be just fine for reading and learning. And there's an even greater gap between "just fine" and "acceptable".
Back to the main points:
Epub is a better format for everything except niche uses (textbooks, especially math, papers, etc) where there's an argument for pdf. It's rather weak, but I understand the argument and I don't throw a fit when such material is only available in pdf. Most regular books aren't even published in pdf format anymore, for good reason.
There's no reason to convert epub to pdf except to print it — and why the hell would you do that? buy a used print copy — or to send to someone who doesn't have an epub reader — in which case you're better off giving them the name of an epub app to search for and install, so that they can read epubs in the future, rather than converting every epub you want them to read into poor quality pdfs.
Meanwhile, mathjax will only improve, along with publishers' general css competence.
Your comment makes no sense. If you want to read a math-heavy do and you stumble on unreadable text, your experience doesn't suddenly improve if you say "well at least I can get JAWS to play audio". There is no tradeoff.
You can bring in MathML into ePub with no problem. I guess your question then is “are there renderers that support MathML?” The answer to that is yes: Kobos have good MathML support.
Fortunately, most stuff that I read is math-heavy thus unfeasible as an epub. Yet, there is the rare essay, interview or otherwise math-less text that comes in the annoying epub format that needs to be converted.
Different strokes for different folks, I guess. I do a lot of reading on a kindle and convert whatever I need using Calibre, but PDFs, because of their fixed formatting, are a bit of a nightmare.
I'm not complaining about anything; I'm actually happy that math texts are not usually distributed in epub so that I don't get to use those silly auto-reflowing viewers!
Which is also its downside when formatting is not critical. I want to be able to change the font size and have the text reflow correctly. With PDFs you end up with broken layouts if you don't view it exactly as formatted.
>>I want to be able to change the font size and have the text reflow correctly. With PDFs you end up with broken layouts if you don't view it exactly as formatted.
Reflowable books also do a poor job reflowing content.
Case in point, the free AWS ebooks on kindle are a god-awful mess whenever they add code snippets, no matter how small.
Given the choice, a good fixed format layout beats a bad reflowable layout.
Especially as the choice of layout and elements like fonts is neither trivial nor unimportant, and a good readable code font is not easily replaced with $monospace_font_goes_here
Send my public domain book to my grandma who doesn't know how to handle an epub? Convert it because it is easier to print as a .pdf with my particular setup?
There are all kinds of potential use cases for users of differing levels of technical sophistication.
Why wouldn't you provide an option to convert to .pdf?
> A file with the .MOBI file extension is used for storing eBooks. It was originally a Mobipocket Reader format but has since been adopted by several different readers as well. Amazon purchased Mobipocket in 2005, and later discontinued the MOBI format in 2011.
> The current Kindle formats (AZW3, KF8, and KFX) are based on MOBI and is a proprietary format exclusively used on Kindle devices. And, in fact, you can still open files with the MOBI format directly on your Kindle
And (another fun fact) if you want to email EPUBs to your kindle, just make the file extension .png (!?) and it will be automatically converted, without the need for Calibre.
Most people HN would want it since we are power users who like desktop apps. But don’t rob yourself of trying to understand why everyone else doesn’t want to use desktop software to get a book on their Kindle.
For example, my girlfriend is an avid ebook reader but couldn’t be less interested in it. “I can see why that could be useful but... no thanks.”
We like the smell of our own farts too much sometimes. In this case, in the form of “why don’t people want to use more software to do what you were already doing without it?”
> But don’t rob yourself of trying to understand why everyone else doesn’t want to use desktop software to get a book on their Kindle.
Yes, that's a good point. I originally had "Why would you want to go without Calibre when it's so multi-functional?", but changed it to "Who knows why you'd want …" in an aim to sound less confrontational. I seem instead to have gone the other way!
I can download an epub on my mobile. I can email an epub from my mobile.
I can't run calibre from my mobile. I can rename .epub to .png and email that from my mobile.
Yes, I can host calibre somewhere else. No, my technologically savvy friends and family cannot. I also don't want them to depend on me to be able to convert an epub for their kindle when there's a trivial solution that doesn't require additional dependencies.
Because the only feature I've ever needed from Calibre is ePub conversion and Amazon will do that for me without hassle (and without access to desktop computer).
Kindle has jumped around in formats over the years. It's been AZW (which is basically mobi), AZW3, and now KFX. I assume that KFX is what this tool is calling "Kindle".
I'd think I'll stick with the tried and true `ebook-convert` tool from Calibre, and pandoc. There's no sense uploading your documents to a third party when that's not necessary.
You cannot -- Kindle ebooks are in a format called KFX (or AZW/mobi or AZW3, depending on when you got them), which this tool doesn't support as an input.
If you wanted to do that, I'd just use Calibre, which has really comprehensive format conversion abilities: https://calibre-ebook.com
Most Kindle ebooks have DRM as well, which I think is currently hard to remove -- there's a plugin for calibre that you could try. Some publishers don't apply it, though, so maybe.
This is a fantastic way to read books published by Tor on multiple devices. Now if only Tor would sell the ePub files on their website. (Tor eBooks are not DRMed.)
I'm an author on Amazon and wonder: Is this also true if I switch off DRM for my books on Amazon? Could someone clarify this? I publish all my books without DRM.
And indeed once you purchased his books you can download a DRM-free epub or pdf file of the book you purchased and use any tool you like to read it.
I don't see similar note on the listings of his books on Kindle store, so my _guess_ would be that Amazon is unwilling do fulfill this request from the author, but I could be wrong (I never owned any kindle device anyways).
The Kindle store doesn't make it obvious if something is DRM free anymore. The most obvious way is that DRM free books will usually list the number of simultaneous devices as unlimited while DRM books will not. Happy to be corrected if there is a nicer way of telling.
And unfortunately I don't think the DRM for the latest format (KFX) has been cracked yet. The best anybody can do is work around it by getting Amazon to send you the book in an older Kindle format but then you lose all the nice things that you get with KFX.
> The best anybody can do is work around it by getting Amazon to send you the book in an older Kindle format but then you lose all the nice things that you get with KFX.
What do you get with KFX? It's hard for me to imagine any goodies I'd rather have than a file that I own and can read at my leisure.
One really nice feature you get is that if Amazon decides they want to delete the book from your kindle they can. It's a nice feature for Amazon and the publishers love it as well.
The writing is on the wall though - DRM is getting better and the easy to crack formats will probably fade away soon.
The solution isn't technical (ie better cracks), it's legislative. Books are special and most e-books shouldn't be DRM'd. Purchasers of ebooks should have the right to resell, to gift, to bequeath, to trade, and do all the other things that have been part of book culture for the past few hundred years.
April 2018: As of version 6.6.0, Apprentice Alf's DRM removal tools support Amazon's newer .kfx file format. You'll also need to install the KFX conversion plugin(link is external) to import your .kfx files into Calibre.
> Note that DRM can only be removed from KFX format files downloaded with Kindle for PC/Mac 1.26 or earlier. Amazon changes the DRM for KFX files in Kindle for PC/Mac 1.27 and later.
KFX is different from older versions in that the file is tailored to the device it is downloaded on. If you download with the Kindle for PC, the file is optimized for your big, high resolution screen and isn't going to be great on an eink device.
There are no cracks that work with the KFX files extracted from the Kindle reader.
I haven't tried with this tool yet but I would be surprised if so, purchased Kindle books usually have quite a bit of DRM involved.
There are methods to strip it using old versions of the desktop kindle app that have exploits, but it's not overly easy to do if you're not familiar with stuff like that.
Search for "Apprentice Alf" for a DRM stripping plugin for Calibre. This is how I liberated my kindle library. Once you've stripped the DRM, you can freely convert them to epub.
Well, two epubs gave a "something went wrong" when converting to HTML, which is the only output I'm really curious about. I got one conversion to PDF to work, then went back to try html, and now I've got to wait an hour... :(
Nice tool but ack!, yet another this file format to that file format conversion tool.
A book is not a file. It never will be.
I know half the unixy nutcases won't agree with anything normal but in reality the world will continue to buy dead-tree books because no real consumer believes or wants these stupid files. Or will pay for it. Meh, the trash.
There is a growing market for ebooks. I have a lot of friends who are not tech literate who prefer buying on their kindle for the convenience of having one small device rather than shelves of paper.
Both markets will continue to exist for a long time for different reasons and readers.
> ...for the convenience of having one small device rather than shelves of paper.
Yeah, that’s why people moved away from cassettes to Youtube. I have a lot of friends who gave their Kindles away and are back into paperbacks and/or the iPads.