Forum How do I...?

Convert PrinceXML PDF to Kindle?

theadventmaster
Per our customer (DocRaptor):

> I’m downloading the pdf and then importing into kindle where it converts the file. If you could open the ticket, that would be great and let me know then I can keep an eye on it as well. Thank you very much.

Formatting of PDF is being lost when importing into Kindle. Not sure if this is something on the PrinceXML radar. We're not particularly familiar with PDF to Kindle format conversion ourselves, and I'm not sure if there are any settings we could supply to ensure a smooth conversion.
  1. doc-136484317 (1).pdf1.8 MB
    PDF being sent to Kindle for conversion.
phillipgessert
It's doing that because it's trying to convert it to a reflowable Kindle format. PDF > Kindle conversions are notorious for a tendency to mangle layout. I would think they'd have better luck converting from the HTML source, though even then I think there are aspects to this layout that won't work well for a reflowable ebook.

AFAIK you can just view a PDF with no conversion at all on some (most?) Kindles. There is also a fixed layout format for ebooks that basically works the same way. But if somewhere in this workflow a conversion is taking place, it's almost certainly trying to convert to reflowable.

Since ebooks are bundles of HTML files, I would think that the first step toward PrinceXML trying to address something like this would be the ability to somehow roundtrip the PDF back to HTML. And maybe that's possible now, I never tried it because I assumed most of the semantic stuff is lost in the PDF.

After that, next issue is that ebooks use a smaller subset of CSS than PrinceXML does, and some (like the prince-* rules) can even break the ebook's styling altogether for some devices.

Next, the main way to then convert the ebook to Kindle's mobi format is by using Amazon's proprietary Publisher tools like kindlegen. I'd think that's kind of a big obstacle because I don't think you can bundle it into your software. I say that because most ebook authoring tools I know of prompt you to download kindlegen yourself.

And finally, none of that necessarily addresses the conversion from a fixed format to a reflowable one. Stuff's still gonna get lost, it might just get lost more nicely.

It'd be a neat feature, and I'd be lying if I said I wouldn't love it myself; but it seems super tough to me--granted I obviously know nothing about what PrinceXML does under the hood, ha.