![]() |
#1 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Dec 2009
Device: Cool-ER
|
EPUB (CSS) tweaker app
Hi all,
A week or so I posted about how frustrating it was that, when using Calibre to convert from LIT format, you have no control about the justification of your final EPUB - depending on the LIT it'll either be left justified or fully justified, but you get no ability to choose your preferred option. The sound of tumbleweeds drifting by was deafening (translation: no-one appeared to care based on the lack of responses I got to my post). In the end I threw together the attached Java app and am posting here in case others also find it useful. Basically, it'll open up an EPUB and let you edit the CSS directly, then let you save the changes, saving you the aggro of extracting the EPUB and repacking it afterwards. In the simple editor the more "interesting" attributes (ie. the ones I find myself changing most often) are bolded, to assist the user when scanning down them: text-align: font-size: and text-indent: Those of you not CSS savvy, basically if you look for any references to text-align: left and change them to text-align: justify, that should do the trick. On some LIT conversions I've seen double paragraph indentation happen - usually this is because there's a base style called section AND individual styles for the paragraphs, both with an indent. If you remove the text-indent line from the section style, that'll resolve the double indent. This has not been tested to any great degree so you are advised to back up any EPUBs first! It's also only been tested on a Mac (but it's Java, so should run OK on pretty much anything). To use, download the file, BUT DO *NOT* EXTRACT THE ZIP. Instead, rename it from epub-tweaker.zip to epub-tweaker.jar. If you have Java you should then be able to run it by double-clicking, and load an EPUB from the File menu. |
![]() |
![]() |
![]() |
#2 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
Wonderful! I was wondering about something to do just that (see https://www.mobileread.com/forums/showthread.php?t=69837).
Your script works on my Mac! I will tinker with it in depth shortly, but it looks like just what I want to amend CSS from ePub titles that I have purchased, but which don't render nicely on the PRS-600 or iPhone. Brilliant stuff. Many thanks. Last edited by ChristopherTD; 01-21-2010 at 02:46 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,434
Karma: 1525776
Join Date: Aug 2009
Location: TAS, Australia
Device: Astak Pocket Pro (Black), 2 x Kindle WiFi (Graphite), iPod Touch 4G
|
Absolutely brilliant. I posted a while ago about converting from .LIT to .EPUB with text justification problems. This java app solves the problem. Just for your reference I ran it on Ubuntu 9.10 without any issues.
Thanks for posting the app. |
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
Outstanding! Using this I was quickly able to refine a troublesome book so that it easy to read on my PRS-600.
Many, many thanks for such a wonderful little utility! |
![]() |
![]() |
![]() |
#5 | ||
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Quote:
Anyway Kudos for creating a tool to help the community here. ![]() |
||
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Dec 2009
Device: Cool-ER
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
Also, if you are tweaking the CSS for a book purchased in ePub format, this avoids the need to do an ePub-2-ePub conversion in Calibre (a usually harmless step, but one that cannot easily be undone).
|
![]() |
![]() |
![]() |
#8 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,684
Karma: 134319572
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Providing the eBook has no DRM or you are able to strip the DRM.
|
![]() |
![]() |
![]() |
#9 | |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
Quote:
![]() That said, your utility is awesome... I gave it a shot and it looks like it will be really handy. Nice one! |
|
![]() |
![]() |
![]() |
#10 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Welcome to Mobileread.
![]() Quote:
This feature is essentially built into calibre via the right click menu. Select the book you wish to tweak in calibre's library view. Right click the book and choose Tweak Epub, explode the epub and open the css in your favorite editor, I use notepad++. Edit and save the css, rebuild epub. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hacked AdobeViewer.app with userstyle1.css | tselling | PocketBook | 62 | 10-29-2012 10:40 PM |
converting to epub with my css | fbrzvnrnd | Calibre | 3 | 04-15-2010 02:46 AM |
ePub to ePub - just replace CSS? | ChristopherTD | Calibre | 21 | 02-11-2010 02:50 AM |
Modifier le .css d'un .epub | freak | Software | 9 | 11-26-2009 03:58 AM |
Firefox Tweaker: Flexbeta FireTweaker XP | Alexander Turcic | Lounge | 0 | 08-16-2004 04:51 AM |