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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-14-2009, 09:00 AM   #1
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Help! Newbie having problems converting HTML/CSS files

I'm pretty new to ebooks, HTML and the PRS-505 so I wonder if someone could help or point me in the right direction. I am very much in the explore-and-find-out-what-works stage at the moment.

To tidy up MSWord's generated HTML, I wanted to extract all the style info into a re-usable CSS file. The HTML plus linked CSS loads fine in my browser.
When I upload to calibre the HTML and CSS file get zipped into a single file in the normal way. However, when I convert to LRF or EPUB the styling in the CSS doesn't seem to be used.
Could one of you experts please tell me whether this is what you would expect or make a suggestion what I might be doing wrong? I can force the CSS to be used by using the ConvertEbooks/Look&Feel/ExtraCSS option to point at a copy of the CSS file on my C: disk but I had hoped to use this option as a style 'tweaker' rather than for the whole lot.

FYI I have tried unzipping calibre's zip file to make sure the HTML and CSS still function as a pair after the upload. They seem fine. I've also tried copying the CSS content back into the HTML file and re-uploading that as a single file. That works fine as well.
I also know I could forget about HTML/CSS and just upload the MSWord file as RTF. I don't do this because of the formatting which seems to be lost using RTF (centre- & right-alignment, line breaks etc), and anyway where would be the fun in that!

Any enlightenment would be appreciated. Who knows, one of these days I might actually get round to reading a book on my shiny new SonyReader!
jackie_w is offline   Reply With Quote
Old 09-14-2009, 01:18 PM   #2
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The first place to look is the conversion log in calibre. Click the rotating hourglass icon and the click job details. If the CSS file is not being picker up for some reason, there should be a warning about it in the log.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-14-2009, 03:25 PM   #3
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Further testing ...

Thanks for your reply Kovid.

I have done as you suggest. This is the job detail output from an LRF conversion:-

Convert book 1 of 1 (Verse_css)
Processing archive...
InputFormatPlugin: HTML Input running on c:\docume~1\jackies\locals~1\temp\calibre_0.6.12_u s924a_plumber\content.opf
Parsing all content...
Manifest item 'toc.ncx' not found
Parsing Verse_css.htm ...
Parsing jsebook.css ...
Generating default TOC from spine...
Merging user specified metadata...
Detecting structure...
Detected chapter: Centred verse
Detected chapter: Right-aligned verse
Auto generated TOC with 2 entries.
Inserting metadata into book...
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Cleaning up manifest...
Trimming unused files from manifest...
Parsing stylesheet.css ...
Creating LRF Output...
Unable to find serif family None
Unable to find sans family None
Unable to find mono family None
Processing 'c:\\docume~1\\jackies\\locals~1\\temp\\calibre_0. 6.12_bmm3z6_lrf_output\\jacket.xhtml'
Parsing HTML...
Written preprocessed HTML to c:\docume~1\jackies\locals~1\temp\html2lrf-verbose.html
Converting to BBeB...
Processing 'c:\\docume~1\\jackies\\locals~1\\temp\\calibre_0. 6.12_bmm3z6_lrf_output\\Verse_css.htm'
Parsing HTML...
Written preprocessed HTML to c:\docume~1\jackies\locals~1\temp\html2lrf-verbose.html
Converting to BBeB...
Could not read stylesheet: jsebook.css
Rationalizing font sizes...
LRF output written to c:\docume~1\jackies\locals~1\temp\calibre_0.6.12_m gf9_l.lrf


I can see that it did not like the CSS file but I'm not sure why.

I also did an EPUB conversion with all the same conversion parameters. This was the job output:-

Convert book 1 of 1 (Verse_css)
Processing archive...
InputFormatPlugin: HTML Input running on c:\docume~1\jackies\locals~1\temp\calibre_0.6.12_e q6hja_plumber\content.opf
Parsing all content...
Manifest item 'toc.ncx' not found
Parsing Verse_css.htm ...
Parsing jsebook.css ...
Generating default TOC from spine...
Merging user specified metadata...
Detecting structure...
Detected chapter: Centred verse
Detected chapter: Right-aligned verse
Auto generated TOC with 2 entries.
Inserting metadata into book...
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Cleaning up manifest...
Trimming unused files from manifest...
Parsing stylesheet.css ...
Creating EPUB Output...
Splitting on page-break
Splitting on page-break
Looking for large trees in Verse_css.htm...
No large trees found
Split into 2 parts
Looking for large trees in jacket.xhtml...
No large trees found
Removing anchor from TOC href: Verse_css_split_0.htm#calibre_toc_2
Removing anchor from TOC href: Verse_css_split_1.htm#calibre_toc_3
EPUB output written to c:\docume~1\jackies\locals~1\temp\calibre_0.6.12_j s1crb.epub

I'm not sure what this tells me.


Viewing both LRF and EPUB via the ebook/lrf-viewers shows the formatting has not been used. Viewing the ZIP via the ebook-viewer shows the formatting as OK.

To an expert eye, there may be something very obviously wrong with the CSS or HTML file. Have I missed some kind of header(s)? I'm going to feel such an idiot when I find out what it is! I've attached the small HTML and CSS files I used. If you could spare any time to have a look I'd be very grateful.
Regards, Jackie
Attached Files
File Type: txt Verse_css.htm.txt (749 Bytes, 330 views)
File Type: txt jsebook.css.txt (2.1 KB, 268 views)

Last edited by jackie_w; 09-14-2009 at 03:42 PM. Reason: missed the front-end of the LRF output
jackie_w is offline   Reply With Quote
Old 09-14-2009, 03:27 PM   #4
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Attach the calibre created ZIP file.
kovidgoyal is offline   Reply With Quote
Old 09-14-2009, 04:00 PM   #5
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Adding zip file as requested

That was quick.
Attached Files
File Type: zip Verse_css - Aaa Aaa.zip (2.3 KB, 336 views)
jackie_w is offline   Reply With Quote
Advert
Old 09-14-2009, 04:44 PM   #6
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The first thing to change is in your header where you have

rel="Stylesheet"

change that to

rel="stylesheet"

(In the next release of calibre I'll have it ignore case for this).
kovidgoyal is offline   Reply With Quote
Old 09-14-2009, 04:53 PM   #7
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Well that seems to have done the trick. Thank you so much, Kovid.

I just knew I was going to feel like an idiot!!
jackie_w is offline   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
[Old Thread] New to Calibre--problems converting files rxmom03 Calibre 4 07-04-2012 09:46 PM
Error in converting files html --> Mobipocket adamsloco Calibre 0 08-29-2009 10:30 PM
Problems generating ePub from HTML/CSS AlexBell Calibre 3 07-17-2009 05:10 AM
Problem converting HTML files to LRF red_five Calibre 2 06-09-2009 03:03 AM
Problems Converting files using libprs500 nosfuerato Calibre 3 12-27-2007 08:33 AM


All times are GMT -4. The time now is 07:07 AM.


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