Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-18-2008, 03:20 AM   #1
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: 44,557
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
EPUB output

The long awaited support for epub as an output format is finally here; as of calibre version 0.4.86. In the GUI just select EPUB as your output format in the config dialog. Then all conversion/news fetching operations will result in EPUB files. The command line interface is in the commands: any2epub, comic2epub and feeds2epub.

To see usage information, run the commands without any arguments. I've tested them on a number of ebooks and feeds in avarious different input formats, and they should be ready for more general testing now. So throw your ebooks at them and report any bugs here.

For e.g.
Code:
any2epub file.lit
The only major missing feature is support for font size rationalization and embedding fonts.

Technical note:

For those of you that run epubcheck on the output files, you may get warnings/errors for files in the content/ subdirectory. This is because html2epub doesn't fully convert input files into valid XHTML 1.1 (doing so would likely lead to information loss and is uneccessary because any epub reading software that insists on valid XHTML 1.1 is going to be a miserable failure). However, if you feed html2epub valid XHTML 1.1, then it should output valid XHTML as well.

Last edited by kovidgoyal; 09-23-2008 at 11:58 PM.
kovidgoyal is online now   Reply With Quote
Old 09-18-2008, 12:26 PM   #2
JeffElkins
Guru
JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.
 
JeffElkins's Avatar
 
Posts: 780
Karma: 1416
Join Date: Jan 2008
Device: Kobo Clara 2E/HD, Kindle PW
Congratulations on this milestone!

Code:
html2epub dead_until_dark.html
Building file list...
        Parsing jeff/southern_vampire/dead_until_dark.html
Traceback (most recent call last):
  File "/usr/bin/html2epub", line 8, in <module>
    load_entry_point('calibre==0.4.84b3', 'console_scripts', 'html2epub')()
  File "/home/jeff/calibre/src/calibre/ebooks/epub/from_html.py", line 96, in main
    convert(args[1], opts)
  File "/home/jeff/calibre/src/calibre/ebooks/epub/from_html.py", line 78, in convert
    resource_map = parse_content(filelist, opts)
  File "/home/jeff/calibre/src/calibre/ebooks/epub/from_html.py", line 66, in parse_content
    resource_map, filelist)
  File "/home/jeff/calibre/src/calibre/ebooks/epub/from_html.py", line 21, in __init__
    self.extract_css()
  File "/home/jeff/calibre/src/calibre/ebooks/html.py", line 447, in extract_css
    css.append('#%s {%s}'%(id, 'page-break-before:always'))
UnboundLocalError: local variable 'id' referenced before assignment
This was with b17
JeffElkins is offline   Reply With Quote
Advert
Old 09-18-2008, 01:21 PM   #3
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: 44,557
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by JeffElkins View Post
Congratulations on this milestone!

Code:
html2epub dead_until_dark.html
Building file list...
        Parsing jeff/southern_vampire/dead_until_dark.html
Traceback (most recent call last):
  File "/usr/bin/html2epub", line 8, in <module>
    load_entry_point('calibre==0.4.84b3', 'console_scripts', 'html2epub')()
  File "/home/jeff/calibre/src/calibre/ebooks/epub/from_html.py", line 96, in main
    convert(args[1], opts)
  File "/home/jeff/calibre/src/calibre/ebooks/epub/from_html.py", line 78, in convert
    resource_map = parse_content(filelist, opts)
  File "/home/jeff/calibre/src/calibre/ebooks/epub/from_html.py", line 66, in parse_content
    resource_map, filelist)
  File "/home/jeff/calibre/src/calibre/ebooks/epub/from_html.py", line 21, in __init__
    self.extract_css()
  File "/home/jeff/calibre/src/calibre/ebooks/html.py", line 447, in extract_css
    css.append('#%s {%s}'%(id, 'page-break-before:always'))
UnboundLocalError: local variable 'id' referenced before assignment
This was with b17
Fixed, thanks.
kovidgoyal is online now   Reply With Quote
Old 09-19-2008, 02:20 AM   #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: 44,557
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
version 0.4.84 (to be released in a few hours) has a working any2epub. Enjoy.
kovidgoyal is online now   Reply With Quote
Old 09-19-2008, 06:19 AM   #5
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
So now to add support for other formats such as RB or IMP, one would just need to implement epub2rb and epub2imp, right?
ashkulz is offline   Reply With Quote
Advert
Old 09-19-2008, 11:10 AM   #6
JeffElkins
Guru
JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.
 
JeffElkins's Avatar
 
Posts: 780
Karma: 1416
Join Date: Jan 2008
Device: Kobo Clara 2E/HD, Kindle PW
Quote:
Originally Posted by kovidgoyal View Post
version 0.4.84 (to be released in a few hours) has a working any2epub. Enjoy.
Epubs created from the command line with .84 don't open with page invalid errors on my 505. Additionally, metadata appears correct in calibre, but is missing when viewed on the 505 (e.g. author is Unknown.)

These epubs can be read with FBReader.

Last edited by JeffElkins; 09-19-2008 at 11:28 AM.
JeffElkins is offline   Reply With Quote
Old 09-19-2008, 11:31 AM   #7
babyd
Addict
babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.
 
babyd's Avatar
 
Posts: 384
Karma: 1567
Join Date: Jul 2008
Location: UK
Device: Sony:505, 600, 350, 650, Kindle 3 & PW, Kobo Mini & Aura HD
Okay, I've probably done something really silly, any ideas what's happening?
Have been using Calibre for a few months now, with no issues.

I have updated to the new version. It asked me where my books were stored so I gave it the path, it loaded them in great....now my usual way of doing things, is to add the book to Calibre and convert (or add a lrf and not convert), then save to my HD using Calibre as this gives me all my books sorted by author in one place on my HD. The I import into the Sony eLibrary and then to my reader. All has been great, until the update today.....

When I went to import a new book from Calibre I noticed there were now 2 files for each book. I had the author/title folders but now had another titled the same but with numbers in brackets next to it (database number?). This has happened on all my existing books too, effectively doubling my entire library.........I really don't want 2 copies of all my books (obviously) so how to resolve? What am I doing wrong for Calibre to make 2 copies of all books?

I noticed that if I delete books from Calibre then the numbered folder goes leaving the usual title folder, it's only when I store them in Calibre that I see the 2 folders for each title......any way to stop this as it doubles my library when I use Calibre to list my books as well. Short of entering all books, saving, then removing them from Calibre, is there a way round it?


I hope someone can help
babyd is offline   Reply With Quote
Old 09-19-2008, 11:39 AM   #8
JeffElkins
Guru
JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.
 
JeffElkins's Avatar
 
Posts: 780
Karma: 1416
Join Date: Jan 2008
Device: Kobo Clara 2E/HD, Kindle PW
Quote:
Originally Posted by babyd View Post
I hope someone can help
Are you discussing epub format? if not, you need to open your own thread. What you've done is called thread hijacking.
JeffElkins is offline   Reply With Quote
Old 09-19-2008, 11:41 AM   #9
babyd
Addict
babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.babyd once ate a cherry pie in a record 7 seconds.
 
babyd's Avatar
 
Posts: 384
Karma: 1567
Join Date: Jul 2008
Location: UK
Device: Sony:505, 600, 350, 650, Kindle 3 & PW, Kobo Mini & Aura HD
terribly sorry, wasn't my intention. I thought it was valid as it was relevant only to this updated version...........

Im just gonna uninstall it anyway and go back to the older one, so no worries.

once again, my apologies

Last edited by babyd; 09-19-2008 at 11:44 AM.
babyd is offline   Reply With Quote
Old 09-19-2008, 11:44 AM   #10
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: 44,557
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by ashkulz View Post
So now to add support for other formats such as RB or IMP, one would just need to implement epub2rb and epub2imp, right?
Yeah. Though opf2imp would actually be sufficient since calibre's epub files are really just thin wrappers around an opf file + content
kovidgoyal is online now   Reply With Quote
Old 09-19-2008, 11:46 AM   #11
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: 44,557
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by JeffElkins View Post
Epubs created from the command line with .84 don't open with page invalid errors on my 505. Additionally, metadata appears correct in calibre, but is missing when viewed on the 505 (e.g. author is Unknown.)

These epubs can be read with FBReader.
That's probably because you've hit the 300K file size limit for constituent parts of an epub. At the moment, the code to automatically split large files into smaller parts is not implemented. As for the metadata, not sure why that's not being read, I'll look into it.
kovidgoyal is online now   Reply With Quote
Old 09-19-2008, 11:47 AM   #12
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: 44,557
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by babyd View Post
Okay, I've probably done something really silly, any ideas what's happening?
Have been using Calibre for a few months now, with no issues.

I have updated to the new version. It asked me where my books were stored so I gave it the path, it loaded them in great....now my usual way of doing things, is to add the book to Calibre and convert (or add a lrf and not convert), then save to my HD using Calibre as this gives me all my books sorted by author in one place on my HD. The I import into the Sony eLibrary and then to my reader. All has been great, until the update today.....

When I went to import a new book from Calibre I noticed there were now 2 files for each book. I had the author/title folders but now had another titled the same but with numbers in brackets next to it (database number?). This has happened on all my existing books too, effectively doubling my entire library.........I really don't want 2 copies of all my books (obviously) so how to resolve? What am I doing wrong for Calibre to make 2 copies of all books?

I noticed that if I delete books from Calibre then the numbered folder goes leaving the usual title folder, it's only when I store them in Calibre that I see the 2 folders for each title......any way to stop this as it doubles my library when I use Calibre to list my books as well. Short of entering all books, saving, then removing them from Calibre, is there a way round it?


I hope someone can help
calibre maintains a private copy of your book file (earlier the copy was stored in your database file, so you didn't see it).
kovidgoyal is online now   Reply With Quote
Old 09-19-2008, 12:00 PM   #13
JeffElkins
Guru
JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.
 
JeffElkins's Avatar
 
Posts: 780
Karma: 1416
Join Date: Jan 2008
Device: Kobo Clara 2E/HD, Kindle PW
Quote:
Originally Posted by kovidgoyal View Post
That's probably because you've hit the 300K file size limit for constituent parts of an epub. At the moment, the code to automatically split large files into smaller parts is not implemented. As for the metadata, not sure why that's not being read, I'll look into it.
The single html file is 619K and the cover image is 33K. I bet this will come up a lot
JeffElkins is offline   Reply With Quote
Old 09-19-2008, 12:14 PM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,458
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
But would it not be possible to have any2epub split at the chapter marks and/or manual page breaks?
JSWolf is offline   Reply With Quote
Old 09-19-2008, 12:24 PM   #15
Hadrien
Feedbooks.com Co-Founder
Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.Hadrien understands the importance of being earnest.
 
Hadrien's Avatar
 
Posts: 2,263
Karma: 145123
Join Date: Nov 2006
Location: Paris, France
Device: Sony PRS-t-1/350/300/500/505/600/700, Nexus S, iPad
Quote:
Originally Posted by JSWolf View Post
But would it not be possible to have any2epub split at the chapter marks and/or manual page breaks?
That's the first step but it's not enough.
Hadrien is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] Epub Output: Line Height greenapple Conversion 20 01-27-2013 10:27 AM
EPUB output justification toki08 Calibre 10 01-08-2011 05:14 PM
Calibre epub output details and Nook squidward Calibre 6 11-24-2010 04:21 PM
epub output metadata troymc Calibre 5 05-22-2010 01:23 AM
Problem with epub output in Cybook Gen3 fjf Calibre 3 02-03-2010 03:23 AM


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


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