Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 03-30-2011, 11:11 AM   #1
icecreamassassin
Junior Member
icecreamassassin began at the beginning.
 
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
icecreamassassin is offline   Reply With Quote
Old 03-30-2011, 11:16 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,314
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://bazaar.launchpad.net/~kovid/c.../revision/8634
kovidgoyal is offline   Reply With Quote
Old 03-30-2011, 11:32 AM   #3
icecreamassassin
Junior Member
icecreamassassin began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
Quote:
Originally Posted by kovidgoyal View Post
Ah! Thanks. Looks like it should be taking care of ADE magic.

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.
icecreamassassin is offline   Reply With Quote
Old 03-30-2011, 11:45 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,314
Karma: 5382313
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.
kovidgoyal is offline   Reply With Quote
Old 03-30-2011, 07:49 PM   #5
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,885
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by icecreamassassin View Post
Ah! Thanks. Looks like it should be taking care of ADE magic.

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.
The change Kovid pointed to for handling the margins in a Adobe page template will be in the next version of calibre.
DoctorOhh is offline   Reply With Quote
Old 04-01-2011, 08:38 PM   #6
icecreamassassin
Junior Member
icecreamassassin began at the beginning.
 
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.
icecreamassassin is offline   Reply With Quote
Old 04-01-2011, 09:18 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,314
Karma: 5382313
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.
kovidgoyal is offline   Reply With Quote
Old 04-01-2011, 09:38 PM   #8
icecreamassassin
Junior Member
icecreamassassin began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
Quote:
Originally Posted by kovidgoyal View Post
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.
Well, within the associated .html files in the ePub, it is identified thusly:

<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?
icecreamassassin is offline   Reply With Quote
Old 04-01-2011, 09:40 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,314
Karma: 5382313
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?
kovidgoyal is offline   Reply With Quote
Old 04-01-2011, 09:47 PM   #10
icecreamassassin
Junior Member
icecreamassassin began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
Quote:
Originally Posted by kovidgoyal View Post
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?
I am not running from source; I am rocking an Ubuntu box and installed via the shell as per the download instruction on the Calibre site...

...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?
icecreamassassin is offline   Reply With Quote
Old 04-01-2011, 09:48 PM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,314
Karma: 5382313
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
kovidgoyal is offline   Reply With Quote
Old 04-01-2011, 09:55 PM   #12
icecreamassassin
Junior Member
icecreamassassin began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
Quote:
Originally Posted by kovidgoyal View Post
If you are running a source install then you cannot even start newer calibre versions with python 2.6
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?
Attached Files
File Type: txt calibre.0.7.53.log.txt (271.5 KB, 78 views)
icecreamassassin is offline   Reply With Quote
Old 04-01-2011, 09:59 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,314
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, that doesn't help. You should open a aticket and atatch your epub file.
kovidgoyal is offline   Reply With Quote
Old 04-01-2011, 10:06 PM   #14
icecreamassassin
Junior Member
icecreamassassin began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kobo
Quote:
Originally Posted by kovidgoyal View Post
No, that doesn't help. You should open a aticket and atatch your epub file.
Yeah figured that wouldn't be all that helpful. I'll open a ticket, but unfortunately due to the nature of this epub, licensing precludes me from attaching it.
icecreamassassin is offline   Reply With Quote
Old 04-01-2011, 10:13 PM   #15
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,314
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can mark the ticket as private.
kovidgoyal is offline   Reply With Quote
Reply

Tags
ade, calibre, kobo, margins, page-template.xpgt

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 06:25 PM.


MobileRead.com is a privately owned, operated and funded community.