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 11-12-2019, 07:01 PM   #256
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,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by Fahi View Post
Hi, I found this image to use as a background. I don't know CSS but I tried to figure out how it works and how to make the text fit into this background searching on the forum and on the internet in vain.
When i try to add body margin on top for example, i lose a part of the text at the bottom.
You are seeing why I settled on the settings I did when I posted how I set up the viewer in post 246 above. I think you are running into limitations of the QT webengine. You can set top and bottom margins in preferences, but this shrinks your image. This is why my image doesn't have the dark book like edges because the text gets lost in the darker edges. If you don't use a background image the margins set in preferences work great. Good Luck. Maybe somebody else can crack this issue, but after banging my head against the wall you can see what I settled on above.
DoctorOhh is offline   Reply With Quote
Old 11-16-2019, 12:47 PM   #257
Fahi
Junior Member
Fahi began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2019
Device: pc
Quote:
I think you are running into limitations of the QT webengine.
After spending a few hours on that, I was wondering if the problem wasn't something like that :P
Finally i took your background image, which is great too. I just modified it a little to simulate a book that suits me better. I put also the croped background i wanted to use initially.

And i use this css
Code:
body{
 margin-top: 0.15em !important;
}

p{
 margin-bottom: 0.3em !important; 
 margin-left:   6.5em !important;
 margin-right:  6.5em !important;
}

h2,h3,h4,h5,h6{
 margin-left: 4.5em !important;
}
I'm still interested if someone find a solution to put a space at the top and bottom of pages.

I hope in a future update we can deal with the body margin, that would solve all these problems Anyway thanks for this great software and thank you Doc for your time responding to me.
Attached Thumbnails
Click image for larger version

Name:	book1.jpg
Views:	557
Size:	190.6 KB
ID:	174977   Click image for larger version

Name:	book2.jpg
Views:	537
Size:	233.5 KB
ID:	174978  
Fahi is offline   Reply With Quote
Old 12-18-2019, 10:20 AM   #258
duns
Connoisseur
duns began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Sep 2017
Device: PocketBook
It's possible, with the latest release, to customize also the "upper" row (id=book-top-margin)? I tried this, but unsuccessfully:

#book-top-margin {background-color: gray !important; color: rgb(252, 252, 252) !important;}
duns is offline   Reply With Quote
Old 12-18-2019, 11:50 AM   #259
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
margins take the same color as whatever backgroud color you have defined in the coor preferences for the viewer.
kovidgoyal is offline   Reply With Quote
Old 12-20-2019, 03:46 AM   #260
duns
Connoisseur
duns began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Sep 2017
Device: PocketBook
Quote:
Originally Posted by kovidgoyal View Post
margins take the same color as whatever backgroud color you have defined in the color preferences for the viewer.
Thank you!

Yes, but why not let to customer ... customize that colors (with css)?

Last edited by duns; 12-20-2019 at 03:51 AM.
duns is offline   Reply With Quote
Old 12-20-2019, 04:14 AM   #261
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Because I dont see the point, why would anyone want margins in a different color from the page? And if you really do, the set the page color to what you want the margins to be and use an image as the page background.
kovidgoyal is offline   Reply With Quote
Old 12-20-2019, 05:48 AM   #262
duns
Connoisseur
duns began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Sep 2017
Device: PocketBook
Quote:
Originally Posted by kovidgoyal View Post
Because I dont see the point, why would anyone want margins in a different color from the page? And if you really do, the set the page color to what you want the margins to be and use an image as the page background.
Maybe we don't understand each other: I don't mean "margins", but the top bar, i.e. where you can put the title of the ebook and the like. That I would differentiate it from the body of the text because it is not the body of the text.
I simply ask you to give the possibility, if a css expert customer wants, to differentiate that background (css ID #book-top-margin).
duns is offline   Reply With Quote
Old 12-20-2019, 07:51 AM   #263
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That is the top margin, and is it is separated by whitespace from the text of the book, just as in all paper books for instance. You can control how much space there is yby changing the size of the margin.
kovidgoyal is offline   Reply With Quote
Old 12-20-2019, 12:08 PM   #264
duns
Connoisseur
duns began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Sep 2017
Device: PocketBook
Quote:
Originally Posted by kovidgoyal View Post
That is the top margin, and is it is separated by whitespace from the text of the book, just as in all paper books for instance. You can control how much space there is yby changing the size of the margin.
Thank you.
We are not all "made in the same way" : personally I would prefer to see "author" and "title" and "chapter" with a background that distinguishes it from the body of the text.
Is would be technically difficult to let users (with css knowlegde) customize this background?
duns is offline   Reply With Quote
Old 12-20-2019, 04:41 PM   #265
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,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by duns View Post
Thank you.
We are not all "made in the same way" : personally I would prefer to see "author" and "title" and "chapter" with a background that distinguishes it from the body of the text.
Is would be technically difficult to let users (with css knowlegde) customize this background?
Maybe something like this (see attached)? I used the latest calibre to setup the book viewer as shown.
Attached Thumbnails
Click image for larger version

Name:	book_example.jpg
Views:	882
Size:	422.8 KB
ID:	175766   Click image for larger version

Name:	book_example-2.jpg
Views:	624
Size:	418.4 KB
ID:	175769  

Last edited by DoctorOhh; 12-20-2019 at 05:38 PM.
DoctorOhh is offline   Reply With Quote
Old 12-21-2019, 04:27 AM   #266
duns
Connoisseur
duns began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Sep 2017
Device: PocketBook
Quote:
Originally Posted by DoctorOhh View Post
Maybe something like this (see attached)? I used the latest calibre to setup the book viewer as shown.
Yes, thanks, like that!
Today I managed to get something similar (see the image attached), but now Calibre viewer is become very slow...

EDIT

No: I have changed something and now the speed is normal. This is my css code:
Code:
body {
  counter-reset: section;  /* Set a counter named 'section', and its initial value is 0. */
  background-image: radial-gradient(white 20%, #e5e4dc 70%) !important;
}

h2 {
  counter-reset: paragraph;    /* Set a counter named 'section', and its initial value is 0. */
  counter-increment: section; /* Increment the value of section counter by 1 */
}
p::before {
     counter-increment: paragraph;       /* Increment the value of parag counter by 1 */
     content: "[cap." counter(section) ", para." counter(paragraph) "] "; 
     color: gray; font-size: 70%;
}
h2 {background: #B35A31 linear-gradient(to left, #B35A31 80%, #F4E492 105%); color: white !important; font-weight: bold !important; text-shadow: gray -1px -1px;  border-radius: 8px; box-shadow: 5px 4px 4px gray;  margin-bottom: 25px !important;}

h3, h4 {color: #B35A31 !important; border-bottom: thin white solid;}

div {max-width: 90vw !important; margin-left: auto; margin-right: auto;}
Attached Thumbnails
Click image for larger version

Name:	Calibre stilished.png
Views:	1171
Size:	404.4 KB
ID:	175776  

Last edited by duns; 12-21-2019 at 05:30 AM.
duns is offline   Reply With Quote
Old 12-21-2019, 05:28 AM   #267
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What size image are you using for the background?
kovidgoyal is offline   Reply With Quote
Old 12-21-2019, 06:39 AM   #268
duns
Connoisseur
duns began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Sep 2017
Device: PocketBook
Quote:
Originally Posted by kovidgoyal View Post
What size image are you using for the background?
Not an image, but css (radial-gradient).
duns is offline   Reply With Quote
Old 12-29-2019, 10:38 PM   #269
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 724
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by DoctorOhh View Post
Maybe something like this (see attached)? I used the latest calibre to setup the book viewer as shown.
DoctorOhhh could you share the code?
dunhill is offline   Reply With Quote
Old 12-30-2019, 03:46 AM   #270
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,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by dunhill View Post
DoctorOhhh could you share the code?
No special code. I described how I set things up in post 246. But I attached the adjustments I entered in Viewer - Preferences to get this look. Essentially no margins left, right or bottom. Change the color so the background and fore a different then add code in style to change the book text color back to black.

In calibre preferences I did create a Save to Disk metadata plugboard (see attached) to save the Author - Title to the title field upon using the Save to Disk feature to get the Author and title to display where only the Title would normally appear. This means I would have to use the Save to Disk feature to save the book into a reading directory before I read the book.

This was just an exercise to show what could be done with existing settings. I use the setup in post 246 myself.
Attached Thumbnails
Click image for larger version

Name:	Styles.jpg
Views:	991
Size:	315.2 KB
ID:	175982   Click image for larger version

Name:	colors.jpg
Views:	616
Size:	191.0 KB
ID:	175983   Click image for larger version

Name:	Headers and footers.jpg
Views:	643
Size:	140.6 KB
ID:	175984   Click image for larger version

Name:	Page Layout.jpg
Views:	642
Size:	294.0 KB
ID:	175985   Click image for larger version

Name:	metadata plugboard.jpg
Views:	627
Size:	349.9 KB
ID:	175986   Click image for larger version

Name:	bigback.jpg
Views:	556
Size:	466.0 KB
ID:	175987   Click image for larger version

Name:	book_example.jpg
Views:	634
Size:	422.8 KB
ID:	175988   Click image for larger version

Name:	calibre viewer screenshot Post 246.jpg
Views:	587
Size:	1.39 MB
ID:	175991  

Last edited by DoctorOhh; 12-30-2019 at 04:36 AM.
DoctorOhh 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-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 01:30 PM.


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