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 09-29-2010, 03:44 PM   #1
slantybard
my parent's oops...
slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.
 
Posts: 334
Karma: 1427200
Join Date: Feb 2009
Device: Vx->Handera->Clie-> Axim->505->650->KPW/Aura
page-template.xpgt conversion problems in ePub

OK, I have had some issues in the ePub to ePub conversions. Several books that were originally created with adobe software are not behaving when it comes to conversion css overrides in calibre. Usually, I just delete the css stylesheet in the original ePub and this makes it all better. However, I now have an ePub that has a "page-template.xpgt" file that implements justification and margins that I don't like. I can access this file from within calibre or sigil for tweaking, but if I just delete it from the ePub, it hangs my reader after conversion. Is there a simple, quick (even if dirty) way of getting rid of this template from my ePub that allows me to apply the css override during conversion? I have put the code from the template below:

Code:
<?xml version='1.0' encoding='utf-8'?>
<ade:template xmlns="http://www.w3.org/1999/xhtml" xmlns:ade="http://ns.adobe.com/2006/ade" xmlns:fo="http://www.w3.org/1999/XSL/Format">

  <fo:layout-master-set>

  <fo:simple-page-master master-name="single_column">
    <fo:region-body margin-bottom="1.5em" margin-top="1.5em" margin-left="1.5em" margin-right="1.5em"/>
    </fo:simple-page-master>

    <fo:simple-page-master master-name="two_column" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
    <fo:region-body column-count="2" column-gap="10pt"/>
    </fo:simple-page-master>

    <fo:simple-page-master master-name="two_column_head" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
    <fo:region-before extent="8.3em"/>
    <fo:region-body column-count="2" column-gap="10pt"/>
    </fo:simple-page-master>

    <fo:simple-page-master master-name="three_column" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
    <fo:region-body column-count="3" column-gap="10pt"/>
    </fo:simple-page-master>

    <fo:simple-page-master master-name="three_column_head" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
    <fo:region-before extent="8.3em"/>
    <fo:region-body column-count="3" column-gap="10pt"/>
    </fo:simple-page-master>

    <fo:page-sequence-master>
        <fo:repeatable-page-master-alternatives>
            <fo:conditional-page-master-reference master-reference="three_column_head" page-position="first" ade:min-page-width="80em"/>
            <fo:conditional-page-master-reference master-reference="three_column" ade:min-page-width="80em"/>
            <fo:conditional-page-master-reference master-reference="two_column_head" page-position="first" ade:min-page-width="50em"/>
            <fo:conditional-page-master-reference master-reference="two_column" ade:min-page-width="50em"/>
            <fo:conditional-page-master-reference master-reference="single_column"/>
        </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>

  </fo:layout-master-set>

  <ade:style>
    <ade:styling-rule selector=".title_box" display="adobe-other-region" adobe-region="xsl-region-before"/>
  </ade:style>

</ade:template>
Thanks for any help.
slantybard is offline   Reply With Quote
Old 09-29-2010, 04:10 PM   #2
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,497
Karma: 424627
Join Date: Mar 2009
Device: iPad
When you removed it from the ePub, did you also remove references to it from the OPF file?

G
GRiker is offline   Reply With Quote
Old 09-29-2010, 05:18 PM   #3
slantybard
my parent's oops...
slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.
 
Posts: 334
Karma: 1427200
Join Date: Feb 2009
Device: Vx->Handera->Clie-> Axim->505->650->KPW/Aura
Thanks, I forgot to do that. So, in the end, I deleted the stylesheet, the page-template.pgxt, removed the reference in the opf file, and then converted in calibre with my css override. Annoying, not the cleanest file/workflow, but it worked.

Thanks for your assistance.
slantybard is offline   Reply With Quote
Old 09-29-2010, 08:04 PM   #4
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,889
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by slantybard View Post
Thanks, I forgot to do that. So, in the end, I deleted the stylesheet, the page-template.pgxt, removed the reference in the opf file, and then converted in calibre with my css override. Annoying, not the cleanest file/workflow, but it worked.
I may be wrong, but for future reference I thought if you deleted the page-template.pgxt file via Sigil then saved the epub, that Sigil updates the other references.
DoctorOhh is offline   Reply With Quote
Old 10-01-2010, 01:06 AM   #5
slantybard
my parent's oops...
slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.
 
Posts: 334
Karma: 1427200
Join Date: Feb 2009
Device: Vx->Handera->Clie-> Axim->505->650->KPW/Aura
Quote:
Originally Posted by dwanthny View Post
I may be wrong, but for future reference I thought if you deleted the page-template.pgxt file via Sigil then saved the epub, that Sigil updates the other references.
I actually tried that first, but the resulting epub crashed my reader.
slantybard is offline   Reply With Quote
Old 10-01-2010, 06:57 AM   #6
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,889
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by slantybard View Post
I actually tried that first, but the resulting epub crashed my reader.
Good to know. I thought you did it via the tweak epub feature and not through Sigil.
DoctorOhh is offline   Reply With Quote
Old 10-11-2010, 10:18 AM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,915
Karma: 18763702
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by GRiker View Post
When you removed it from the ePub, did you also remove references to it from the OPF file?

G
Also, reference has to be removes from all of the XML files as well.
JSWolf is offline   Reply With Quote
Old 02-17-2011, 01:38 AM   #8
JonDeus
HackJOB
JonDeus began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Feb 2011
Device: Nook Color, iPad, Android(Epic), PC.
I am using Sigil( I have calibre also), and when I removed the .xpgt file and removed the xhtml links, it loaded on Nook and adobe digital editions just fine. i didn't know about an OPF retaining info. I use Calibre for checking code and epub.

Is having this .xpgt file a must for iPad and iPhone devices?
JonDeus is offline   Reply With Quote
Old 02-19-2011, 11:57 AM   #9
slantybard
my parent's oops...
slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.
 
Posts: 334
Karma: 1427200
Join Date: Feb 2009
Device: Vx->Handera->Clie-> Axim->505->650->KPW/Aura
I have no idea if it is necessary for the ipad/iphone devices since I actually don't have either. If you don't want to delete it, you can also simply change the code of the file which is also quite easy to do - just open in an editor. For example, my issues were the huge margins showing up on my sony reader so I looked in the file and changed the margins on the section that described how a single column is supposed to be shown.
slantybard is offline   Reply With Quote
Old 02-28-2011, 10:08 AM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,915
Karma: 18763702
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by JonDeus View Post
I am using Sigil( I have calibre also), and when I removed the .xpgt file and removed the xhtml links, it loaded on Nook and adobe digital editions just fine. i didn't know about an OPF retaining info. I use Calibre for checking code and epub.

Is having this .xpgt file a must for iPad and iPhone devices?
Nope. It's actually more of an annoyance then anything actually useful. You do not need the page template. It can go. I remove it every time I see it.
JSWolf is offline   Reply With Quote
Old 03-09-2011, 12:57 AM   #11
mufc
Connoisseur
mufc doesn't littermufc doesn't litter
 
Posts: 99
Karma: 170
Join Date: Nov 2010
Location: Airdrie Alberta
Device: Sony 650
I exploded the epub then deleted the css file and the page-template.xpgt file. I then rebuilt the epub and reconverted to epub with my settings in Preferences/ Common Options.
the book is working fine on my Sony 650 so far.
Am I just lucky?

Some people are also saying to delete the references in the opf file
In the opf file then you just delete these lines ?
Spoiler:
<item href="styles/stylesheet.css" id="style" media-type="text/css"/>
<item href="styles/page-template.xpgt" id="page-template" media-type="application/adobe-page-template+xml"/>


and some say they even go as far as deleting references in the xml/html files.
and in each html file delete ?
Spoiler:
<link href="../styles/stylesheet.css" rel="stylesheet" type="text/css"/>

<link href="../styles/page-template.xpgt" rel="stylesheet" type="application/adobe-page-template+xml"/>


Is this correct. It seems like a lot of extra work each time I want a book to look the way I want.
Thanks
mufc is offline   Reply With Quote
Old 03-09-2011, 05:37 AM   #12
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 651
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
It'll be fine for your own purposes, but if your publishing for others then you will need to clean it up and validate it.
Perkin is offline   Reply With Quote
Old 03-09-2011, 08:31 AM   #13
mufc
Connoisseur
mufc doesn't littermufc doesn't litter
 
Posts: 99
Karma: 170
Join Date: Nov 2010
Location: Airdrie Alberta
Device: Sony 650
When you say clean up, you mean by stripping the references to css and page-template.xpgt in the opf file and xml/html files correct ?
Why would that not validate afterwards ?

I just exploded a book I had previously done and a css file is back. Looks like Calibre inserted one but if I remove the links to it now what will happen.
CSS
Spoiler:
@namespace h "http://www.w3.org/1999/xhtml";
.calibre {
display: block;
font-family: "MyFonts", serif;
font-size: 1.08333em;
line-height: 1.2;
margin-bottom: 0;
margin-left: 2pt;
margin-right: 2pt;
margin-top: 0;
padding-left: 0;
padding-right: 0;
text-align: left
}
.calibre1 {
border-bottom: 0;
border-top: 0;
display: block;
margin-bottom: 0;
margin-top: 0;
padding-bottom: 0;
padding-top: 0;
text-indent: 1.5em
}
.calibre2 {
border-bottom: 0;
border-top: 0;
display: block;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
padding-bottom: 0;
padding-top: 0;
text-indent: 1.5em
}
.calibre3 {
display: block
}
.calibre4 {
border: 0;
border-bottom: 0;
border-top: 0;
display: block;
height: 1em;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
padding-bottom: 0;
padding-top: 0;
text-indent: 1.5em
}
.calibre5 {
display: block;
margin-bottom: 1em;
margin-left: 1em;
margin-right: 1em;
margin-top: 1em
}


What does .calibre2 thru calibre5 stand for ?
.calibre is my font settings etc
.calibre1 is no space between paragraphs I THINK
What are the rest ?

I want to get my books looking the way I like but I do not want to screw it up for anyone else.


Is it not better to replace the css file with my own (the one calibre made for me in this instance) and just get rid of page-template.xpgt and any references to that ?



OK now I really am confused. On checking opf/html files of a book I previously exploded, and deleted the page-template.xpgt and css files, I now find another css file (calibres) but all references in the html files and opf files to page-template.xpgt are gone. Also each html file even though having still a link to stylesheet1.css, my styles created in calibre are in the head of each page.

Has Calibre become even more sophisticated lately ?

Kudos if so.

Last edited by mufc; 03-09-2011 at 08:46 AM.
mufc is offline   Reply With Quote
Old 03-15-2011, 05:39 AM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,915
Karma: 18763702
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
When you have a page-template file, delete it. Then in each XML file, delete the reference to it. Also delete the reference to it in the OPF file. I use notepad++ and this makes it very easy to handle this for however many XML files there are.

As for the CSS, deleting it is a rather bad idea. Take the CSS and edit it to make the ePub look how you want it to look. That way, you won't lose things like italics, bold, font sizes and other things. You will have to look in the XML files to see what CSS entries you may want to edit. I do this a lot and overall, it's not difficult to do.
JSWolf is offline   Reply With Quote
Old 03-15-2011, 09:35 PM   #15
mufc
Connoisseur
mufc doesn't littermufc doesn't litter
 
Posts: 99
Karma: 170
Join Date: Nov 2010
Location: Airdrie Alberta
Device: Sony 650
I think you will find that when you explode the epub and delete the page-template file and then rebuild the epub that calibre removes all references to it. Try it by exploding the epub again. Also you can do the same with the css file because Calibre builds a new one from what you put in Preferences/ Common Options
mufc is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] epub -> mobi conversion; blank page after image joubert Calibre 10 03-07-2011 06:26 PM
epub to mobi conversion problems rcdc Calibre 5 09-18-2010 03:29 AM
epub conversion problems Reko Calibre 0 08-24-2010 01:03 AM
LIT to EPUB conversion problems stratman Calibre 3 01-28-2010 12:50 PM


All times are GMT -4. The time now is 03:39 AM.


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