09-09-2010, 03:17 PM | #16 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Sep 2010
Location: California
Device: PRS-505
|
Quote:
First, apparently there is a problem when prince gets absolute paths to the files in command-line. So I have modified script to pass file names only, and changed workdir for the prince in the Popen call. Again, see attached in the previous post. That produces working links - sometimes. Now there is another problem, when the link happens to refer to an empty span. It depends on a book, obviously. I think it's a known bug in the prince. Last edited by viktorz; 09-15-2010 at 04:39 AM. |
|
09-10-2010, 08:55 AM | #17 | |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Could you run the attached file (load an ePUB and convert it to PDF) and copy whatever it outputs to the terminal? I'd like to see what's happening exactly to the file paths, or maybe you can explain it Regarding you other changes, I've incorporated them, but haven't uploaded it yet. |
|
09-11-2010, 12:52 AM | #18 | ||
Junior Member
Posts: 7
Karma: 10
Join Date: Sep 2010
Location: California
Device: PRS-505
|
Quote:
Quote:
Code:
OPS\cover.xhtml OPS\ch1.xhtml OPS\ch2.xhtml OPS\ch3.xhtml OPS\ch4.xhtml OPS\ch5.xhtml OPS\ch6.xhtml OPS\ch7.xhtml OPS\ch8.xhtml OPS\ch9.xhtml OPS\ch10.xhtml OPS\ch11.xhtml OPS\ch12.xhtml OPS\ch13.xhtml OPS\ch14.xhtml OPS\ch15.xhtml OPS\ch16.xhtml OPS\ch17.xhtml OPS\ch18.xhtml OPS\ch19.xhtml OPS\ch20.xhtml OPS\ch21.xhtml OPS\ch22.xhtml OPS\ch23.xhtml OPS\ch24.xhtml OPS\ch25.xhtml OPS\ch26.xhtml OPS\ch27.xhtml OPS\ch28.xhtml OPS\ch29.xhtml OPS\ch30.xhtml OPS\ch31.xhtml OPS\ch32.xhtml OPS\ch33.xhtml ['C:\\Program Files\\Prince\\Engine\\bin\\prince.exe', '-v', '-s', 'c:\\users\\myname\\appdata\\local\\temp\\tmpxt9o1b\\tmp6gghkl', '-o', 'C:\\Utils\\epub2pdf \\epub2pdf.pdf', u'OPS/cover.xhtml', u'OPS/ch1.xhtml', u'OPS/ch2.xhtml', u'OPS/c h3.xhtml', u'OPS/ch4.xhtml', u'OPS/ch5.xhtml', u'OPS/ch6.xhtml', u'OPS/ch7.xhtml ', u'OPS/ch8.xhtml', u'OPS/ch9.xhtml', u'OPS/ch10.xhtml', u'OPS/ch11.xhtml', u'O PS/ch12.xhtml', u'OPS/ch13.xhtml', u'OPS/ch14.xhtml', u'OPS/ch15.xhtml', u'OPS/c h16.xhtml', u'OPS/ch17.xhtml', u'OPS/ch18.xhtml', u'OPS/ch19.xhtml', u'OPS/ch20. xhtml', u'OPS/ch21.xhtml', u'OPS/ch22.xhtml', u'OPS/ch23.xhtml', u'OPS/ch24.xhtm l', u'OPS/ch25.xhtml', u'OPS/ch26.xhtml', u'OPS/ch27.xhtml', u'OPS/ch28.xhtml', u'OPS/ch29.xhtml', u'OPS/ch30.xhtml', u'OPS/ch31.xhtml', u'OPS/ch32.xhtml', u'OP S/ch33.xhtml'] |
||
09-11-2010, 04:13 AM | #19 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
OK, so apparently the only source of pernicious "\" is the os.path.join, when used to read files from the ZIP. Then the best solution is probably not using os.path.join, but simply adding a hard-coded "/" when needed. I've done this in a few places. For the actual prince run, even though it seems it's not needed, I've replaced "/" with the OS-specific path separator, just to be "cleaner".
Please try this and tell me how it works. |
09-11-2010, 04:53 AM | #20 |
Junior Member
Posts: 7
Karma: 10
Join Date: Sep 2010
Location: California
Device: PRS-505
|
Works OK
|
10-20-2010, 07:58 PM | #21 |
Member
Posts: 14
Karma: 10
Join Date: Feb 2010
Device: Jetbook
|
I have a question concerning the table of content generated.
At present my reader (Jetbook) can only read one level of TOC (no sub-levels), other wise it crashes the reader. The epub2pdf generator does a superb job of creating a TOC, but I would like to limit it to the top level. Is this possible? What do I need to do? Thanks. --Tony |
10-21-2010, 07:01 AM | #22 | |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
If you mean an inline TOC, which appears just as a normal page (or many pages) in the PDF, then that's hard-coded in the ePUB, and you'd have to edit it. |
|
10-23-2010, 12:35 AM | #23 |
Member
Posts: 14
Karma: 10
Join Date: Feb 2010
Device: Jetbook
|
Thank you for the reply.
Yes I believe I meant the bookmarks that are created as a popup TOC in my reader (and as a side bar in Linux pdf readers). I have tried your suggestion and it did bring some changes, though I am still a bit bewildered as to how to get just the top level eg: Chapter 1 -->Headings -->Sub-headings Chapter 2 -->Headings --> Sub-headings Chapter 3 --> Headings --> Sub-headings etc I only want Chapter 1, Chapter 2, Chapter 3 and none of the other nested headings. I shall keep experimenting and see if I can happen on to it. Thanks again. --Tony |
10-23-2010, 04:22 AM | #24 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
You'd have to take a look at the code (which you can do selecting the html files in the drop-down list next to "CSS files" in epubutils.py) and see what is used for Chapter 1 (maybe <h1>Chapter 1</h1>), what for Headings (maybe <h2>Headings</h2>) and what for Sub-heading (maybe <h3>Sub-heading</h3>). Then you should modify the CSS rules passed to prince accordingly, by adding "prince-bookmark-level: none;" to the elements you don't want in the TOC.
|
03-20-2011, 02:53 PM | #25 |
Junior Member
Posts: 3
Karma: 10
Join Date: Mar 2011
Device: iLiad 2
|
epubutils with slight modifications
Hi people,
maybe it's a too old thread, but here it is. I needed to convert from ePUB to PDF in a decent quality, and I landed onto this forum. The tool written by Jellby works fine and has a nice GUI, but I had troubles converting a number of ePUB files. So I modified the code (it required the Author field to be non-empty), and also added some code to remove the annoying PrinceXML annotation on the first page of the PDF. I also created a python package (by adding a setup.py script and splitting the code into library and start script). If Jellby or anyone is interested, let me know and I'll publish the code. Bye insomniac |
03-20-2011, 02:57 PM | #26 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Mar 2011
Device: iLiad 2
|
Quote:
insomniac |
|
03-21-2011, 02:40 PM | #27 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I would like to see the modifications at least, and incorporate them in my version if you don't mind
Except for removing the Prince logo. It's good if you can do it yourself (and I have something similar too), but since the Prince people offer a free version and expect those wanting the "full" version (without the logo) to pay, I think it's rather unfair to them to offer such a tool pre-packaged. |
03-22-2011, 07:16 AM | #28 |
Junior Member
Posts: 3
Karma: 10
Join Date: Mar 2011
Device: iLiad 2
|
Excluding the logo removal, the project didn't change much, except for a re-packaging and a try..except on the author name. I'm sending you a PM with the link to the sources, feel free to take only what you need and include in your project :-)
Cheers, insomniac |
12-20-2011, 06:54 AM | #29 |
Junior Member
Posts: 1
Karma: 10
Join Date: Dec 2011
Device: prs-350
|
Thankyou!
Jellby - I've been looking for this for ages. Works great! I was just about to start down a route of XSLT and FO - you've probably saved me about a fortnight's work. Thanks.
|
01-18-2013, 01:35 PM | #30 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
There was a problem with links in Windows, I think it's fixed in version 1.4.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GUI bug? | edbro | Calibre | 2 | 06-19-2010 09:55 AM |
has anyone tried epub2pdf ? | frabjous | Workshop | 2 | 01-04-2010 02:01 PM |
Gui confusements. | brewt | Calibre | 8 | 12-30-2008 12:16 PM |
epub2pdf | touch_elango | Introduce Yourself | 2 | 10-25-2008 10:36 AM |
Mobi2Mobi GUI Batch | Jad | Kindle Formats | 8 | 10-22-2008 07:22 AM |