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

Go Back   MobileRead Forums > E-Book Software > Calibre

Welcome to the MobileRead Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community today, you will have fewer ads, access to post topics, communicate privately with other members, respond to polls, upload content and access many other special features.

If you have any problems with the registration process or your account login, please contact us.

Hint: Don't have time to visit us daily? Subscribe to our main RSS feed to receive our frontpage posts at your convenience.

Notices

Calibre Calibre is an open-source library manager to view, convert and catalog e-books. Cross-platform (Linux, Windows and OS X)

Reply
 
Thread Tools Search this Thread Display Modes
Old 04-26-2007, 01:20 PM   #1
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
Posts: 10,084
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
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, 2022 views)
File Type: zip demo.zip (58.1 KB, 1720 views)

Last edited by kovidgoyal; 08-21-2007 at 09:04 PM.
kovidgoyal is offline   Reply With Quote
Old 04-26-2007, 01: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: 337
Karma: 701
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, 01:39 PM   #3
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
Posts: 10,084
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
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, 01: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: 337
Karma: 701
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, 01:48 PM   #5
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
Posts: 10,084
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
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, 01: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: 337
Karma: 701
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, 01: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, 02:02 PM   #8
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
Posts: 10,084
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
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, 02:03 PM   #9
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
Posts: 10,084
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
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, 02: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, 02: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: 337
Karma: 701
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, 02:36 PM   #12
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
Posts: 10,084
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
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, 02:40 PM   #13
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
Posts: 10,084
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
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, 01:19 AM   #14
Gameboy70
Connoisseur
Gameboy70 began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Apr 2006
Device: Sony PRS-500
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, 08:31 AM   #15
igorsk
Wizard
igorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankindigorsk has exceeded all limitations known to mankind
 
Posts: 3,111
Karma: 17432
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
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EPUB output kovidgoyal Calibre 613 Yesterday 11:38 PM
ABC Converter output+Caliber JGB Calibre 0 10-17-2008 10:23 PM
reverse display output? LDB Reader Troubleshooting 0 08-11-2008 12:14 AM
Sunrise output encoding lambone Sunrise 3 02-04-2005 02:24 AM


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


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