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 04-26-2007, 12:20 PM   #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: 25,938
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
LRF output

I'm happy to announce html2lrf, an open source, cross-platform HTML to LRF converter that I believe is the most feature-complete converter available. It's distributed as part of libprs500 and will eventually be integrated into its GUI. I've attached an LRF file to show off some of its capabilities.

It has support for CSS, recursive links, inline images, lists, tables, dropcaps and embedded fonts.

If you have an HTML file it chokes on, I want to know about it!

For all you content creators, this presents an alternative content creation path. Just open the source file in you favorite office suite, save it as HTML and run it through html2lrf.

Get it and the rest of libprs500 from https://libprs500.kovidgoyal.net. After installation a command html2lrf will be available. It's self documenting, i.e. just run it to get a list of options. Basic usage is as simple as
Code:
html2lrf myfile.html
I should thank Falstaff for pylrs and esperanc for the initial CSS conversion code.
Attached Files
File Type: lrf html2lrf.lrf (823.9 KB, 2624 views)
File Type: zip demo.zip (58.1 KB, 2184 views)

Last edited by kovidgoyal; 08-21-2007 at 08:04 PM.
kovidgoyal is offline   Reply With Quote
Old 04-26-2007, 12:29 PM   #2
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
Congratulations... so you finally released it!

I just looked at the code, and it's written very nicely.
ashkulz is offline   Reply With Quote
Old 04-26-2007, 12:39 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: 25,938
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Thanks now I have to build the GUI and integrate PDFRead and I'll release libprs500 0.4. So much to do, so little time ;-)
kovidgoyal is offline   Reply With Quote
Old 04-26-2007, 12:44 PM   #4
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
Now that PDFRead is almost feature-complete (can't think of anything more to add) I plan to look into adding more device backends to libprs500 like we discussed.

BTW, I think you should do a strategic renaming of libprs500 ... now it does so much more.
ashkulz is offline   Reply With Quote
Old 04-26-2007, 12:48 PM   #5
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: 25,938
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by ashkulz
Now that PDFRead is almost feature-complete (can't think of anything more to add) I plan to look into adding more device backends to libprs500 like we discussed.

BTW, I think you should do a strategic renaming of libprs500 ... now it does so much more.
Cool adding more devices is a most welcome feature.
Yeah, but I haven't been able to think of a good name. Any suggestions. Also I think I'll wait until it's a little closer to maturity.
kovidgoyal is offline   Reply With Quote
Old 04-26-2007, 12:53 PM   #6
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
BTW, you might want to change your Feisty installation instructions: there's no libusb package, but libusb-0.1-4.
ashkulz is offline   Reply With Quote
Old 04-26-2007, 12:54 PM   #7
AndyQ
Enthusiast
AndyQ began at the beginning.
 
Posts: 38
Karma: 36
Join Date: Dec 2006
Device: Sony Reader PRS-500
Nice work! My first converted book looked very nice with one exception.

The first page was blank except for the following line:
Code:
xml version='1.0' encoding='%SOUP-ENCODING%'
Any ideas why this might be?

BTW I'm running the Windows version of teh html2ltf app.
AndyQ is offline   Reply With Quote
Old 04-26-2007, 01:02 PM   #8
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: 25,938
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by ashkulz
BTW, you might want to change your Feisty installation instructions: there's no libusb package, but libusb-0.1-4.
Thanks, done.
kovidgoyal is offline   Reply With Quote
Old 04-26-2007, 01:03 PM   #9
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: 25,938
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by AndyQ
Nice work! My first converted book looked very nice with one exception.

The first page was blank except for the following line:
Code:
xml version='1.0' encoding='%SOUP-ENCODING%'
Any ideas why this might be?

BTW I'm running the Windows version of teh html2ltf app.
Send me the HTML file that looks like an xml declaration.
kovidgoyal is offline   Reply With Quote
Old 04-26-2007, 01:14 PM   #10
AndyQ
Enthusiast
AndyQ began at the beginning.
 
Posts: 38
Karma: 36
Join Date: Dec 2006
Device: Sony Reader PRS-500
I've just found out why.

The HTML file for some reason had the following xml declaration at the top:
<?xml version="1.0" encoding="UTF-8" ?>

Removing this causes the html file to be converted fine (without the funny front page).

Whether you want to cater for this oddity I'm not sure (its not really common although all browsers handle it OK)
AndyQ is offline   Reply With Quote
Old 04-26-2007, 01:23 PM   #11
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
Quote:
Originally Posted by kovidgoyal
Thanks, done.
Two more packages are also needed: python-qt4-gl python-qt4-sql.

BTW, was looking at the code and looks like it may take some time for me to implement it: The Device interface is not used anywhere, but the PRS500 class is. However, the Device interface is very do-able for the REB1100. For the 1150/1200, you can't really do anything: the whole interface is controlled by the ebook itself, with request coming to a webserver. It *might* be possible to host this in prs500, but I don't think you'd be very interested in it...
ashkulz is offline   Reply With Quote
Old 04-26-2007, 01:36 PM   #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: 25,938
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by AndyQ
I've just found out why.

The HTML file for some reason had the following xml declaration at the top:
<?xml version="1.0" encoding="UTF-8" ?>

Removing this causes the html file to be converted fine (without the funny front page).

Whether you want to cater for this oddity I'm not sure (its not really common although all browsers handle it OK)
Fixed in svn
kovidgoyal is offline   Reply With Quote
Old 04-26-2007, 01:40 PM   #13
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: 25,938
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by ashkulz
Two more packages are also needed: python-qt4-gl python-qt4-sql.

BTW, was looking at the code and looks like it may take some time for me to implement it: The Device interface is not used anywhere, but the PRS500 class is. However, the Device interface is very do-able for the REB1100. For the 1150/1200, you can't really do anything: the whole interface is controlled by the ebook itself, with request coming to a webserver. It *might* be possible to host this in prs500, but I don't think you'd be very interested in it...
Thanks again. Basically if you implement the Device interface I'll take care of the refactoring of the code to only depend on it. There are some additional constants you may have to define that I'll let you know about later. As for the 1150/1200 its up to you, if you're willing to make it work, I'm happy to help as much as I can.
kovidgoyal is offline   Reply With Quote
Old 04-27-2007, 12:19 AM   #14
Gameboy70
Connoisseur
Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.Gameboy70 ought to be getting tired of karma fortunes by now.
 
Posts: 84
Karma: 1002150
Join Date: Apr 2006
Device: Kindle Paperwhite, 3rd Gen iPad
This sounds fantastic, but pardon my ignorance. I've downloaded and installed libprs500 but don't see any html2lrf anywhere in the program, not did I see it as a component during the installation. TIA.
Gameboy70 is offline   Reply With Quote
Old 04-27-2007, 07:31 AM   #15
igorsk
Wizard
igorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfolded
 
Posts: 3,443
Karma: 52235
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
It's a commandline program which resides in the libprs500 folder.
igorsk is offline   Reply With Quote
Reply

Tags
html2lrf, libprs500

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change font of header for LRF Output on PRS 505 duckbill Calibre 3 05-15-2010 11:07 AM
Pissed off with LRF formatting: LRF/LRS clean tool? grimborg LRF 8 02-15-2010 01:14 PM
Fonts for LRF output krischik Calibre 1 10-03-2009 05:01 AM
CBZ > LRF (LRF>HTML/MOBI????) sideburnt Calibre 4 09-15-2009 06:44 AM
libprs500 Issues Converting .LIT to .LRF - .LRF crashes everything vasbinde Calibre 6 02-14-2008 12:16 PM


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


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