View Full Version : Purpose of .xpgt ? Is it necessary ?

08-15-2011, 10:56 AM
Hello -- Mac OSx Sigil user, exporting from InDesign CS5.

What is the purpose of the page_template.xpgt file? Is it necessary for any of the readers? Is it important? Does it cause problems for some readers?

I am exploring an epub generated by the book printer from my InDesign document, and in Sigil, there is a page_template.xpgt file.

When I open the epub in ADE on my computer, the book appears as 2 columns.
When I resize the ADE window down to a narrower width, the book appears as one column. I think the .xpgt file is what allows this behavior.

The rest of this question has to do with the appearance of the size of the book's cover image, and is the reason I am asking about the .xpgt.

On my own, I am creating my first epub exported from InDesign CS5, then opening it in Sigil to fine tune. (I have a solid understanding of xhtml and css.)

I have been reading Liz Castro's Epub book, regarding the size of the cover image, she recommended adding style="width:100%" to the cover html to make it fit the width of any device window, but when I did that, the cover image in ADE on my Mac is huge and fuzzy. Would I fix this by adding a page_template.xpgt file?

Or is there a better way to control the width of the cover image for various devices?

thank you!

08-15-2011, 11:24 AM
The page_template.xpgt file can (and should) simply be removed. You should also remove the links to it that will exist in all the files. You should complain to your printer about their inclusion of this file, which simply interferes with the way the book is rendered and interferes with cross-platform compatibility.

This file only affects the rendering on ADE-equipped readers and represents a very early attempt to extend the page model used for ePub beyond the very limited version offered by CSS 2. Adobe dropped all development on this many years ago, and has only maintained support for reasons of compatibility. It should not be used for new publications.

If it's used properly, it can offer some powerful features, but this only happens in conjunction with specific coding of the css. I have yet to see a single publication that actually uses it as Adobe envisaged. Instead, a default page template is inserted which serves no purpose other than to mess up the page margins that you set in your css stylesheet.

The desktop version of ADE supports multiple columns automatically, so you don't need it for that. While the page-template file offers a more sophisticated and flexible way of specifying the layout of of multiple columns, that will only happen if you edit it yourself and set the parameters appropriately. The default file that they toss in provides no advantage.

Again, my advice is that you complain about this loudly, and if they give you any stick, PM me and I'll send them a stiff email as well. There is absolutely no excuse to be integrating this into new books.

As for your cover image, Liz's advice is right. It sounds like your problem is simply that the image you've used doesn't have enough resolution. The page-template file certainly won't change anything here.

08-15-2011, 01:06 PM
thank you, Charleski - this saves me a lot of time! If I remove it in Sigil, the files should be automatically updated to reflect the deletion, but I will check the files just to make sure.

Regarding the cover image, I used the typical 600x800 size recommended. Maybe my ADE window was just wider than normal? It looks fine if I reduce the size of the window down so that it appears at a normal 6x9 inch size.

Odd, that the file I got from the printer doesn't use the width:100%, but the thumbnail shows the full book image, and it looks fine in ADE, ibooks, etc.
But in the other epub I am creating, that I exported from ID5 and massaged in Sigil, the thumb only shows the top left corner of the cover, without the width:100%

Am i missing something?

thanks again,

08-15-2011, 02:56 PM
see this thread (

There are two ways of setting an image to display using the full page, using either the CSS or using SVG. SVG is a bit safer as it will still work (when the proper values are inserted in the code) no matter what the aspect ratio of the image is. The CSS method is more portable, in case you decide you want to convert your ePub to .mobi, but it assumes that your image has a portrait aspect ratio (which is generally true for covers, but not always).

08-16-2011, 04:46 AM
One use of the .xpgt file is hinted here ( I've used it to work around some bugs in ADE, like making "display: oeb-page-head" elements truly disappear from the page.