Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-20-2011, 04:53 PM   #61
pollito pito
i warned you ...
pollito pito doesn't litterpollito pito doesn't litterpollito pito doesn't litter
 
pollito pito's Avatar
 
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
if you want to have an image as background for the reader, you can try adding something like this
on your user stylesheet CSS (assuming you are on ms-windows)

Code:
body {
background-image:url("file:///C:/Program Files/Calibre2/resources/images/old_paper.png");
}
note the the use / .
pollito pito is offline   Reply With Quote
Old 03-05-2011, 02:56 AM   #62
andy8679
Junior Member
andy8679 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2011
Device: Droid X
I'm sorry but I am very new to Calibre. I have almost the same question as Darkspruce. I found a background of an old style paper that would make it a lot easier on my eyes to read on my laptop. But everything I try in the user stylesheet just keeps the background white. I saved the image to my computer as a .gif file. Can anyone please give me step-by-step info on how to do this, it would be greatly appreciated.
andy8679 is offline   Reply With Quote
Old 03-05-2011, 04:43 PM   #63
Piper_
~~~~~
Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.
 
Piper_'s Avatar
 
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
Quote:
Originally Posted by andy8679 View Post
I'm sorry but I am very new to Calibre. I have almost the same question as Darkspruce. I found a background of an old style paper that would make it a lot easier on my eyes to read on my laptop. But everything I try in the user stylesheet just keeps the background white. I saved the image to my computer as a .gif file. Can anyone please give me step-by-step info on how to do this, it would be greatly appreciated.
My first thought is a typo in the css, or the location of the file.

Can you copy and paste the full CSS you're using? Probably also good to know the format of the book you're trying to read.
Piper_ is offline   Reply With Quote
Old 03-05-2011, 05:26 PM   #64
pollito pito
i warned you ...
pollito pito doesn't litterpollito pito doesn't litterpollito pito doesn't litter
 
pollito pito's Avatar
 
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
.


Could someone please, explain why this thread (it used to be Sticky) is now under Library Management?


As to the question:
Copy your image somewhere, let’s say on:
C:/Program Files/Calibre2/resources/images/old_paper.jpg
Assuming your image is called “old_paper.jpg”
Open an ebook; on the reader preferences paste the following :
body {
background-image:url("file:///C:/Program Files/Calibre2/resources/images/old_paper.png");
}
Close the preferences dialog.
Enjoy
pollito pito is offline   Reply With Quote
Old 03-05-2011, 05:50 PM   #65
Piper_
~~~~~
Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.
 
Piper_'s Avatar
 
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
Polito,
I agree that it would be a good sticky. I'll ask about it.

I moved it to Library Management, because that's where we decided to put posts about calibre's ebook viewer.

We've tinkered with the description a couple of times to make that more clear, but maybe "viewing" still isn't as obvious as it could be. It needs to be, since reading by itself doesn't intuitively fall under management.
Piper_ is offline   Reply With Quote
Old 03-05-2011, 06:20 PM   #66
pollito pito
i warned you ...
pollito pito doesn't litterpollito pito doesn't litterpollito pito doesn't litter
 
pollito pito's Avatar
 
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
Quote:
Originally Posted by Piper_ View Post
Polito,
I agree that it would be a good sticky. I'll ask about it.

I moved it to Library Management, because that's where we decided to put posts about calibre's ebook viewer.

We've tinkered with the description a couple of times to make that more clear, but maybe "viewing" still isn't as obvious as it could be. It needs to be, since reading by itself doesn't intuitively fall under management.
Thanks. What would you think of a viewer sub forum?
pollito pito is offline   Reply With Quote
Old 03-05-2011, 06:50 PM   #67
Piper_
~~~~~
Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.
 
Piper_'s Avatar
 
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
Quote:
Originally Posted by pollito pito View Post
Thanks. What would you think of a viewer sub forum?
Well, it's important to keep the list of subforums as short as we can, so we're trying to make the most out of each one. If there started to be a huge increase in the number of threads about the viewer, it might be considered, but at this point, I expect there are other subtopics that would be ahead in the line.
Piper_ is offline   Reply With Quote
Old 03-11-2011, 10:17 AM   #68
darkspruce
Junior Member
darkspruce began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2011
Device: elonex 511eb
Please can you help me with this.I've never done programming and I found the css links very confusing.
I've tried to change the page as advised by pollito pito
body {
background-image:url("file:///C:/Program Files/Calibre2/resources/images/old_paper.png");
}
I pasted this:
body {
background-image:url("file:///C:/Users /white fang / / Downloads\Downloads\old_paper.png");
}
changed the file name to old_paper to try to keep it the same as the example but nothing changed in the ebook.
Thanks in anticipation.
darkspruce is offline   Reply With Quote
Old 03-11-2011, 10:38 AM   #69
darkspruce
Junior Member
darkspruce began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2011
Device: elonex 511eb
just figured it .
Polito's message should have jpg at the end not png

body {
background-image:url("file:///C:/Program Files/Calibre2/resources/images/old_paper.png");
}

this is good can have fun now!
darkspruce is offline   Reply With Quote
Old 03-11-2011, 03:56 PM   #70
Piper_
~~~~~
Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.
 
Piper_'s Avatar
 
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
Custom Styles for the calibre eBook Viewer

calibre provides several configuration options to customize the way books appear and behave when read within the calibre ebook viewer. One of the options is to use our own style sheet [CSS], to further customize the appearance, from background and text colors to indents and margins.

This sticky will serve as a repository for examples and tips for creating and using your own style sheets.

If you have questions, samples, or other ideas to share, please post them in the discussion thread.


Jump to posts:
How to use the custom CSS option

Misc tips and troubleshooting


Sample CSS - Begin Here

Last edited by Piper_; 03-11-2011 at 04:14 PM.
Piper_ is offline   Reply With Quote
Old 03-11-2011, 03:58 PM   #71
Piper_
~~~~~
Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.
 
Piper_'s Avatar
 
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
How to use the custom CSS option

  • Open any ebook in calibre's viewer.
  • Click on the Options icon in the left
  • Click on the User Stylesheet tab
  • Type or paste the CSS you wish to use. (Note that occasionally, you will need to close then re-open the book to see the effects.)
Font size, type, and other settings can be selected under the General tab of this options dialog.
Piper_ is offline   Reply With Quote
Old 03-11-2011, 04:06 PM   #72
Piper_
~~~~~
Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.
 
Piper_'s Avatar
 
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
Misc Tips and Troubleshooting
__________________

Remember that using this feature will only affect how ebooks appear in calibre's viewer. It will not change the CSS within your ebook. Keep this in mind if you use the calibre viewer to test the results of tweaks you make to your ebook file.

__________________

For a simple tutorial about CSS styles and how to create them,
check out the CSS Tutorial

__________________

For handy color codes - Hex, RGB, Names:
Color Picker: http://www.w3schools.com/tags/ref_colorpicker.asp
Basic colors: http://www.w3schools.com/css/css_colors.asp
Named colors: http://www.w3schools.com/css/css_colorsfull.asp

Run Quick Tests: http://www.w3schools.com/Css/tryit.a...trycss_default


__________________

Pseudo selectors, e.g., a:link, p:first-line, etc. are not supported
-Kovid

__________________

If the book you are reading already defines CSS styles that override your definitions, try adding "!important".

For example:
body {
color: red !important;
}

-Jellby

Last edited by Piper_; 03-11-2011 at 04:42 PM.
Piper_ is offline   Reply With Quote
Old 03-11-2011, 04:11 PM   #73
Piper_
~~~~~
Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.
 
Piper_'s Avatar
 
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
Background and text colors

The CSS below results in a beige background with a dark brown font.

body {
background:#FFF9E3;
color:#5E3E0D;
}


Replace the letters shown in dark red with the color values of your choice.

You can also use rgb values or color names, but the choices for names are limited.

__________________

Margins

Add to the body selector:

body {
background:#FFF9E3;
color:#5E3E0D;
margin-right:75px;
margin-left:75px;

}

Again, replace the values with your choice.
__________________
Other Common Options

body {
background:#FFF9E3;
color:#5E3E0D;
margin-right:75px;
margin-left:75px;
text-align:justify;
line-height:1.25em;
background-image:url("file:///C:/Program Files/Calibre2/resources/images/background.jpg")

}

Note: To use a background image, you must first place one in the folder you're pointing to.
Piper_ is offline   Reply With Quote
Old 04-07-2011, 06:46 PM   #74
OldSeaDog
Junior Member
OldSeaDog began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2011
Location: Washington
Device: calibre
Book Font Color

Question:
If a book already defines the CSS font color, is there a way to override the book’s body definitions?
OldSeaDog is offline   Reply With Quote
Old 05-02-2011, 11:39 AM   #75
butterbescotch
Enthusiast
butterbescotch began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Mar 2011
Device: none
How do I find this "Click on the User Stylesheet tab"?

I can't see it in the preference option.
butterbescotch is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom CSS for output deckoff Calibre 1 08-29-2010 12:55 AM
ePub with custom .css on a 505 dicknskip Sony Reader Dev Corner 3 06-10-2010 12:34 AM
User stylesheets for ePub files salty-horse Sony Reader Dev Corner 12 02-23-2010 08:44 AM
ePub conversion: override existing css with a custom one sbin Calibre 1 01-09-2010 05:03 AM
Calibre's generated css for epub brewt Calibre 7 12-29-2008 10:59 AM


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


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