03-30-2011, 11:11 AM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
|
Calibre and page-template.xpgt
Hello -
I have a Kobo and use Calibre for managing/tweaking my ePub collection. One issue that I have is that on some ePubs the margins are ludicrously large. ePub->ePub conversions eliminate this on some books, but not others. From searching the forums it appears that the presence of 'page-template.xpgt' appears to be the culprit. My understanding is that this is an ADE extension for styling ePubs; from other posts it seems that deleting this file from the bundle and then doing the ePub->ePub conversion fixes the margins. I guess I'm looking for clarification for Calibre interaction with this style sheet - a) does Calibre recognize 'page-template.xpgt' at all? b) if so, do the margin settings apply to this file? c) if not, as it is a non-standard ePub extension, is it appropriate to request Calibre to support it? d) does this make any sense? It currently looks like I'm stuck writing a Plugin to automagically 86 the 'page-template.xpgt' file prior to ePub conversion, but I have the Python skills of a 2-year old (making me hesitant to do such a thing). Thanks |
03-30-2011, 11:16 AM | #2 |
creator of calibre
Posts: 44,559
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
Advert | |
|
03-30-2011, 11:32 AM | #3 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
|
Quote:
I had toyed with the 'Remove fake margins' setting (checked and unchecked), but alas, still had margin issues. I suspect I'm doing something wrong with my settings. I'll try playing with it more this evening. |
|
03-30-2011, 11:45 AM | #4 |
creator of calibre
Posts: 44,559
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Removing fake margins tries hard to only remove margins that are actually intended as page margins, by collecting statistics on what margins are used where, which means that it can sometimes fail to detect the margins.
|
03-30-2011, 07:49 PM | #5 | |
US Navy, Retired
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
|
|
Advert | |
|
04-01-2011, 08:38 PM | #6 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
|
Kovid -
Just tried converting the book in 0.7.53 and still no luck with the margins. The thing I did notice, though, was that in the job log of the conversion I did not at any point in time see a line like: 'Removing page margins specified in the Adobe page template' which, if I'm understanding how you've structured the code, should show up somewhere (as per self.log). Of course I could be reading far too much into that, as I haven't really studied the source much at all. I've tested removing references to page-template.xpgt via the 'Search & Replace' function of the conversion, and that does do the trick for the most part, but something feels kinda 'hackish' about that - I'm not sure what other formatting exists in the .xpgt file and I'm paranoid about annihilating the whole shebang. Thanks again. |
04-01-2011, 09:18 PM | #7 |
creator of calibre
Posts: 44,559
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The Adobe file has to be identified with the correct mime type for calibre to process it. What is the mimetype for it in your epub.
|
04-01-2011, 09:38 PM | #8 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
|
Quote:
<link href="../Styles/page-template.xpgt" rel="stylesheet" type="application/vnd.adobe-page-template+xml" /> The actual page-template.xpgt file doesn't appear to contain any mime info. On top of being Python-dumb, I also a bit html/xml/CSS/ePub dumb, so perhaps that's not quite the info you're looking for? |
|
04-01-2011, 09:40 PM | #9 |
creator of calibre
Posts: 44,559
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That is correct, I have no idea why it isn't being processed for you. Are you runnign from source and if you are did you update the source checkout as well as installing 0.7.53?
|
04-01-2011, 09:47 PM | #10 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
|
Quote:
...but, as I was about to send you more diagnostic info, I just noticed that I am still apparently on Python 2.6.6. I see that for a source install Python 2.7.1 or greater is required. Think that may have something to do with it? |
|
04-01-2011, 09:48 PM | #11 |
creator of calibre
Posts: 44,559
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you are running a source install then you cannot even start newer calibre versions with python 2.6
|
04-01-2011, 09:55 PM | #12 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
|
To clarify: I'm running a binary install, not a source install. It was just something I noticed. I've attached the job log from the conversion; perhaps that may help?
|
04-01-2011, 09:59 PM | #13 |
creator of calibre
Posts: 44,559
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, that doesn't help. You should open a aticket and atatch your epub file.
|
04-01-2011, 10:06 PM | #14 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
|
|
04-01-2011, 10:13 PM | #15 |
creator of calibre
Posts: 44,559
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can mark the ticket as private.
|
Tags |
ade, calibre, kobo, margins, page-template.xpgt |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
page-template.xpgt conversion problems in ePub | slantybard | Conversion | 17 | 04-19-2011 06:44 AM |
Library name as calibre template variable | mdb5972 | Calibre | 6 | 01-15-2011 04:09 PM |
Stupid question about calibre language template | Cammagno | Calibre | 1 | 01-08-2011 09:00 AM |
page-template ? | setzer | Calibre | 13 | 07-28-2009 12:23 AM |
page-template -> running headline | setzer | ePub | 14 | 07-27-2009 04:53 AM |