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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-14-2011, 07:18 PM   #91
jimjo23
Junior Member
jimjo23 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Oct 2011
Device: android
I am new to both Calibre and CSS but managed to follow the directions from this threadhttp://www.mobileread.mobi/forums/sh...ad.php?t=80790.

I tried many times to alter the default text (i.e. CSS body tag) color of an ebook document (specifically and perhaps ironically a "For Dummies" ebook) and tried to apply the CSS stylesheets that users in this thread posted with no success even after converting the book with Calibre's converter to various formats.

I stripped out a few things which in the end I haven't missed. I noticed that calibre assigns its own moniker to the various custom CSS classes in the master stylesheet (i.e. ".Calibre17") and each has its own attributes. What a PITA this process was to figure out for a newbie...

I removed these attributes and their respective settings from all ".CalibreX" instances: "color: xxxx", "background-color: xxxx", and "display: block". For some reason I removed the last one on a whim. I have no clue what it did. Thanks.
jimjo23 is offline   Reply With Quote
Old 10-14-2011, 07:38 PM   #92
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: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by jimjo23 View Post
I removed these attributes and their respective settings from all ".CalibreX" instances: "color: xxxx", "background-color: xxxx", and "display: block". For some reason I removed the last one on a whim. I have no clue what it did. Thanks.
Removing the color references is fine. I never found a need to remove "display: block" so I'm not sure what it does.

Hopefully someone with expertise will be able to help you out shortly.
DoctorOhh is offline   Reply With Quote
Advert
Old 10-14-2011, 08:31 PM   #93
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,091
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
My (very simple) interpretation is it is a confining container:
Think of a Shipping Carton (case) of Energy bars as the <body>.
Inside the case are display packs (24 bars) <p>
Inside the Display pack (usually what you see on the candy counter) a wrapped bars <span>
The bars are what you consume < the authors words >
Each block confine its contents:
A normal block stacks the contents wit the adjacent block

An Inline block places the block alongside


I also believe a block contains properties (prevents adjacent blocks from inheritance)

I would leave the "block: display;" in place

Oh!
Block also permits different controls depending on recognized device family:
Display
Print
Aural ...
theducks is online now   Reply With Quote
Old 10-24-2011, 10:57 AM   #94
cerramadre
Member
cerramadre began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2011
Device: none
Using image as background on Ubuntu 11.04

Hi,

I'm new to Linux so I haven't a clue of where in the main File System folder programs get stored etc.

Does anyone know exactly where I should put my background image to get it to work with the ebook viewer?

My system is using Linux Ubuntu 11.04 - Natty I believe.

Thanks.
cerramadre is offline   Reply With Quote
Old 10-24-2011, 12:13 PM   #95
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,091
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by cerramadre View Post
Hi,

I'm new to Linux so I haven't a clue of where in the main File System folder programs get stored etc.

Does anyone know exactly where I should put my background image to get it to work with the ebook viewer?

My system is using Linux Ubuntu 11.04 - Natty I believe.

Thanks.
User (override) images are put in the <Calibre Configuration directory>/resources/images folder.
To find the folder: Preferences: Miscellaneous: press the button
create the images path if needed
theducks is online now   Reply With Quote
Advert
Old 10-24-2011, 05:37 PM   #96
cerramadre
Member
cerramadre began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2011
Device: none
Quote:
Originally Posted by theducks View Post
User (override) images are put in the <Calibre Configuration directory>/resources/images folder.
To find the folder: Preferences: Miscellaneous: press the button
create the images path if needed
Thanks.
cerramadre is offline   Reply With Quote
Old 10-27-2011, 08:41 PM   #97
_reader
Member
_reader doesn't litter_reader doesn't litter
 
Posts: 24
Karma: 142
Join Date: Sep 2010
Device: K3, KPW
2-Columns Viewer CSS Settings Issue

Quote:
Originally Posted by carthoris View Post
i use those:

NORMAL:
------------------

body {color:rgb(0,0,0);
background-color:rgb(200,200,200);
text-indent:2em;
line-spacing:1.8;
margin-top:0px;
margin-bottom:4px;
margin-right:50px;
margin-left:50px;
text-indent:3em;}
h1, h2, h3, h4, h5, h6
{color:black;
text-align:center;
font-style:italic;
font-weight:bold;}



DARKER:
--------------------

body {color:rgb(0,0,0);
background-color:rgb(192,192,192);
text-indent:2em;
line-spacing:1.8;
margin-top:0px;
margin-bottom:4px;
margin-right:50px;
margin-left:50px;
text-indent:3em;}
h1, h2, h3, h4, h5, h6
{color:black;
text-align:center;
font-style:italic;
font-weight:bold;}





NIGHT:
-------------------

body {color:rgb(184,184,184) ;
background-color:rgb(0,0,0) ;
text-indent:2em;
line-spacing:1.8;
margin-top:0px;
margin-bottom:4px;
margin-right:50px;
margin-left:50px;
text-indent:3em;}
h1, h2, h3, h4, h5, h6
{color:black;
text-align:center;
font-style:italic;
font-weight:bold;}





2 COLUMNS:
-------------------

body
{
color:rgb(0,0,0) !important;
background-color:rgb(200,200,200);
text-align:justify;
line-spacing:1.8;
margin-top:1px;
margin-bottom:1px;
margin-right:10px;
margin-left:10px;

-webkit-column-count: 2;
-webkit-column-gap: 1em;
-webkit-column-rule: 1px dotted;

height: 650px;
width:1200px

text-indent: 2em;
}
h1, h2, h3, h4, h5, h6
{
color:black;
text-align:center;
font-style:italic;
font-weight:bold;
}
I tried the 2-Columns mode (above) which displays 2-cols, but page-forward doesn't advance (either by the arrow-icons, Page Down/Up, space bar, or mouse wheel). Suggestions?

I'm looking to simulate an open book with two pages to view on my laptop or desktop wide screen.
_reader is offline   Reply With Quote
Old 10-29-2011, 10:20 AM   #98
foosion
Connoisseur
foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.
 
Posts: 95
Karma: 4562
Join Date: Sep 2011
Device: Kobo Libra 2
Why does this result in wide margins at the sides of each page (as expected), but the text flush with the top and bottom of Calibre's viewer? I tried larger numbers for margin-top and -bottom, without success.

Code:
body 
{
margin-right:200px !important;
margin-left:200px !important;
margin-top:50px !important;
margin-bottom:50px !important;
}
foosion is offline   Reply With Quote
Old 10-29-2011, 10:32 AM   #99
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: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by foosion View Post
Why does this result in wide margins at the sides of each page (as expected), but the text flush with the top and bottom of Calibre's viewer? I tried larger numbers for margin-top and -bottom, without success.
It would appear that the calibre viewer doesn't do top or bottom margins.
DoctorOhh is offline   Reply With Quote
Old 10-29-2011, 10:38 AM   #100
foosion
Connoisseur
foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.
 
Posts: 95
Karma: 4562
Join Date: Sep 2011
Device: Kobo Libra 2
Quote:
Originally Posted by dwanthny View Post
It would appear that the calibre viewer doesn't do top or bottom margins.
That seems a rather odd omission

Is there any way to fake it in css?

Height:80% didn't work. I believe adding a header and footer would require editing the underlying book.
foosion is offline   Reply With Quote
Old 10-29-2011, 11:22 AM   #101
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: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by foosion View Post
That seems a rather odd omission

Is there any way to fake it in css?
I don't believe there is any way to fake this.

The viewer is a ePub viewer, all formats are essentially converted to a form of ePub prior to viewing. Since ePub is a reflowable format the pages change with the font and screen size. So it basicly scrolls the internal html like a browser. Side margins are simple but top and bottom margins, while possible, are quite a bit harder when you are dealing with a format that has unpredictable page lengths.
DoctorOhh is offline   Reply With Quote
Old 10-29-2011, 11:36 AM   #102
foosion
Connoisseur
foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.
 
Posts: 95
Karma: 4562
Join Date: Sep 2011
Device: Kobo Libra 2
Quote:
Originally Posted by dwanthny View Post
Side margins are simple but top and bottom margins, while possible, are quite a bit harder when you are dealing with a format that has unpredictable page lengths.
Top and bottom margins should be easy to program.

Instead of writing to the screen starting at y coordinate 0 (relative to the containing window), start writing to the screen at y coordinate margin-top (and stop at bottom of window minus margin-bottom). You wouldn't have to make any changes to the flow of the underlying text.

Left and right margins are more complicated, as the text does have to be re-flowed as they change.
foosion is offline   Reply With Quote
Old 10-29-2011, 11:50 AM   #103
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,091
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A

Doesn't <body> apply to the entire file and not just the viewport (Calibre)?
Add onto this the Calibre-viewer connects (flattens) the entire book beginning to end (CR3 does the same) and would naturally discard any top and bottom Body Margins in the process.
theducks is online now   Reply With Quote
Old 10-29-2011, 12:01 PM   #104
foosion
Connoisseur
foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.
 
Posts: 95
Karma: 4562
Join Date: Sep 2011
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post

Doesn't <body> apply to the entire file and not just the viewport (Calibre)?
Add onto this the Calibre-viewer connects (flattens) the entire book beginning to end (CR3 does the same) and would naturally discard any top and bottom Body Margins in the process.
It should be possible to start writing text at X pixels from the top of the window in which the viewer writes text, rather than at 0 pixels as it currently does. If this is not technically "margin-top", it is the functional equivalent.

By "viewport" do you mean the window in which Calibre displays the book?

Last edited by foosion; 10-29-2011 at 12:05 PM.
foosion is offline   Reply With Quote
Old 10-29-2011, 03:54 PM   #105
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,091
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by foosion View Post

By "viewport" do you mean the window in which Calibre displays the book?
Yes. you only get to see part of the body through the (viewer) portal
theducks is online now   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
Custom CSS for output deckoff Calibre 1 08-28-2010 11:55 PM
ePub with custom .css on a 505 dicknskip Sony Reader Dev Corner 3 06-09-2010 11:34 PM
User stylesheets for ePub files salty-horse Sony Reader Dev Corner 12 02-23-2010 07:44 AM
ePub conversion: override existing css with a custom one sbin Calibre 1 01-09-2010 04:03 AM
Calibre's generated css for epub brewt Calibre 7 12-29-2008 09:59 AM


All times are GMT -4. The time now is 03:41 PM.


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