02-09-2013, 01:02 PM | #1 |
Member
Posts: 10
Karma: 10
Join Date: May 2012
Device: kindle
|
Converting Epub to PDF
There are numerous trheads about going from pdf to e-reader formats, but I'm having trouble going the other way:
-I need to convert some ebooks (mobi and/or epub) to pdf files. I've been using Calibre. But I'm not happy with the results. The fonts either come out gigantic or way to small, the margins are never adequatem, and I lose all the hyperlinks (this part may be inevitable). Does anyone have any advice? Ideally, I would want the book to look as close to what a print copy of it would theoretically look like. Most of these are academic books; they are far easier to read and mark up on my iPad as pdf files (using iAnnotate) than using either the Kindle app or iBooks. |
02-09-2013, 03:25 PM | #2 |
Evangelist
Posts: 450
Karma: 343115
Join Date: Nov 2009
Location: Romania
Device: PW2 2014
|
Adjust the margins, font size, etc., to your liking from Calibre's settings before exporting it as a PDF. Or alternatively, convert it as HTML, open it in Word (or similar) and export as PDF from there. The ePub-PDF process is much easier than PDF-ePub, trust me. Epub was developed as both an output and a source, as opposed to PDF that should always be considered a final destination.
Last edited by DSpider; 02-09-2013 at 03:28 PM. |
Advert | |
|
02-09-2013, 05:25 PM | #3 |
Resident Curmudgeon
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Using Calibre, take the ePub, convert it to HTMLZ, unzip the contents, load into Word, fix as needed, print to PDF. Done!
|
02-09-2013, 07:04 PM | #4 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
https://www.mobileread.com/forums/sho...30#post2325330 and the script is somewhere in this thread https://www.mobileread.com/forums/sho...ght=Prince.xml Last edited by roger64; 02-09-2013 at 07:08 PM. |
|
02-10-2013, 03:16 AM | #5 | |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
As Roger says, the script uses Prince, so it's capable of giving a very good-quality output, but it may need some tweaking in the CSS, depending on how the ePub is coded. The good news is you can do most of the tweaking without modifying the actual ePub. Last edited by Jellby; 02-10-2013 at 03:18 AM. |
|
Advert | |
|
02-11-2013, 06:46 AM | #6 |
Member
Posts: 10
Karma: 10
Join Date: May 2012
Device: kindle
|
Thanks! I'll try these.
On a related note, I bought an academic book in Kindle format (no choice here) which in print is a massive multi-columned collection of documents. I converted it from AZW3 to epub and then I compared the two on my iPad - in the Kindle app vs the iBooks app. I couldn't believe how much better it looked in the iBook application. Given that the formats are essentially the same in terms of how formatting works (text reflow, etc), I'm going with the assumption the Apple simply know how to make books like these more pleasing to look at than Amazon's Kindle app. |
02-11-2013, 07:38 AM | #7 | |
Member
Posts: 10
Karma: 10
Join Date: May 2012
Device: kindle
|
Quote:
I know this has something to do with Python, which I know next to nothing about, but I don't want to start installing a whole bunch of things I know little about for an app that may be no better than Calibre. So what is it exactly? And is it better than just messing around with Calibre? |
|
02-11-2013, 09:26 AM | #8 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I don't know what calibre does, but this script simply uses Prince to generate the PDF, and offers a way to add ad-hoc CSS rules. You can install Prince and test it (just Prince) with some HTML files to see if you like what you can get. In principle, Prince offers a better line-breaking algorithm, and some useful CSS extensions (to get real floats, footnotes, generated content, etc.), and hyperlinks are retained. The script just extracts the HTML files from the ePub and passes them to Prince in a command line. You could do the same yourself without python.
If I had enough time and motivation I could probably turn this into a calibre plugin (calibre is python too), but wouldn't mind others doing that either. |
02-12-2013, 08:00 AM | #9 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
I do not know Python. I have heard that on Linux, distros are going to upgrade Python from 2.7 to 3.3 (or maybe it has already been done for some of them). Will your script stop working for such a reason? Will it be necessary to update it? |
02-12-2013, 11:18 AM | #10 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I don't know, I'm pretty much a python newbie... all I know is it works in my system, which still has python 2.7 Anyway, I expect the changes needed for python 3.3, if any, will be relatively straightforward, especially since the script does nothing really fancy.
|
02-12-2013, 06:45 PM | #11 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
I'd like to be such a python newbie... Well; 2.7 for me too. Wait and see. |
02-12-2013, 07:28 PM | #12 | |
Member
Posts: 10
Karma: 10
Join Date: May 2012
Device: kindle
|
Quote:
What's Prince exactly? |
|
02-12-2013, 07:37 PM | #13 | |
Member
Posts: 10
Karma: 10
Join Date: May 2012
Device: kindle
|
Quote:
Once I've unzipped the HTMLZ (using 7-Zip) how do I load it into word? If I just open the Index.html document, it does open, but the hyperlinks don't work. They take me to the top of the page. Whereas in a web browser they do work. So I must be doing something wrong. |
|
02-13-2013, 04:33 AM | #14 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
It is a program that generates PDFs from (x)HTML files (www.princexml.com), with better typesetting and more features than what you usually get from any "print to PDF" option around.
|
02-13-2013, 12:22 PM | #15 |
Imperfect Perfectionist
Posts: 460
Karma: 724664
Join Date: Dec 2011
Location: Ølstykke, Denmark
Device: none
|
7-Zip can open epubs directly (if they're not encrypted, but then it would be illegal anyway). Also, Openoffice Writer can import HTML-files (Insert --> File) with most, if not all formatting intact, and save as PDF (Word 2010 also have the ability to save to PDF, without the need to "print".
Just a couple of tricks to try out ... Regards, Kim |
Tags |
conversion, epub conversion, formatting, kindle, pdf conversion |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Converting pdf into epub? | dorkmania | Workshop | 2 | 08-20-2011 09:02 AM |
Converting From PDF to EPUB | aramzy | Conversion | 1 | 04-05-2011 10:10 PM |
Converting PDF to Epub | nataliew | Sony Reader | 10 | 02-04-2011 01:53 AM |
Converting from PDF to ePub | Adiman423 | Calibre | 9 | 11-24-2010 11:14 AM |
Help with converting PDF to epub | neilmarr | Sigil | 6 | 11-14-2009 09:26 AM |