View Single Post
Old 11-09-2015, 06:07 AM   #109
Nick_1964
Bookworm
Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.
 
Nick_1964's Avatar
 
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
Quote:
Originally Posted by GeoffR View Post
Here is a patch to make the ePub reader ignore any Adobe XPGT stylesheets.

These stylesheets are commonly named page-template.xpgt and often contain page margins. The problem with them is that their margins are added to the @page margins set in the CSS stylsheet, but some readers ignore the XPGT stylesheet, so readers which notice the XPGT stylesheet will end up with larger margins than readers which don't.

I can't find a clean way to prevent the XPGT stylesheet file being loaded, so this patch tries instead to prevent the contents from being recognised. A better approach would be to remove the XPGT stylesheet altogether before sideloading the ePub, which can be done easily using the Modify ePub plugin in Calibre, but the patch has the advantage that it should work with DRM ePubs too.

I haven't tested this patch much, but it seems to work as I expect. It is a multi-version patch and should word with firmware 3.3.0 to 3.18.0, and maybe future firmware versions too.

Paste into librmsdk.so.1.0.0.patch
Spoiler:
Code:
<Patch>
patch_name = `Ignore ePub Adobe XPGT stylesheet (page-template.xpgt)`
patch_enable = `yes`
# Multi-version patch: 3.3.0 - 3.18.0+
find_base_address = `\0template\0`
replace_string = 0001, `t`, `_`
</Patch>
Thank you so much !!
Nick_1964 is offline   Reply With Quote