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-29-2008, 02:14 PM   #751
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: 45,353
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Technically, the LRF format does support borders, but html2lrf doesn't translate this. For that kind of advanced formatting, it should be easier to switch to EPUB anyway.
kovidgoyal is online now   Reply With Quote
Old 11-11-2008, 05:09 AM   #752
kkurma
Junior Member
kkurma began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2008
Device: none
How to use html2lrf

Quote:
Originally Posted by kovidgoyal View Post
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.


Hi

I just want in brief how to use the above given source code in linux.
And is there any c++ source code which can convert html files into lrf file format.

Regards
Krish
kkurma is offline   Reply With Quote
Advert
Old 11-11-2008, 07:47 AM   #753
dmitcalf
Junior Member
dmitcalf began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2008
Device: PRS505
I have spent a fair bit of time playing with the TOC detect features in Calibre and the only thing that seems to work is importing from .prc file which has a TOC already. Importing .LIT does not see the TOC even if the file has one. The auto chapter detect does not work at all in LRF conversion - but I did make it work once converting to EPUB. The conversions were done using test files so I could control the tag name and attribute in the input doc. I have tried HTML, RTF and plain text - no luck with any of them.
dmitcalf is offline   Reply With Quote
Old 11-11-2008, 01:59 PM   #754
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: 45,353
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
TOC detection doesn't create a toc int the file itself. It creates an external toc. You can access the external toc from the menu on the sony reader.
kovidgoyal is online now   Reply With Quote
Old 11-12-2008, 01:52 AM   #755
sauravishal
Junior Member
sauravishal began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2008
Device: none
Hi..

Quote:
Originally Posted by kovidgoyal View Post
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.

Is there any way to create epub to pdf...
sauravishal is offline   Reply With Quote
Advert
Old 11-19-2008, 01:35 PM   #756
ProDigit
Karmaniac
ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.
 
Posts: 2,553
Karma: 11499146
Join Date: Oct 2008
Location: Miami FL
Device: PRS-505, Jetbook, + Mini, +Color, Astak Ez Reader Pro, PPW1, Aura H2O
feat request concearning downloading feeds and converting them to lrf.
Everytime I download a feed and get it converted to lrf, I get in my newsfeeds the message: "Please turn on JavaScript. Media requires Javascript to play."

I wanted to know if it was possible to remove such a line before converting it to lrf.
It's only obvious lrf does not support javascript, and neither does the reader's screen.
Also since Calibre currently is made to fit the sony Reader, and no other mobile devices, I think it's a good idea to remove this 'javascript' line from the html.

So far I haven't seen any CNN newsfeeds with pictures.
If a version uses javascript to display a picture, then it'd be nice to get to convert the first picture to a jpg.
If it uses javascript to display a movie above the article, then it'd be nice to either see the first frame, or nothing at all(kind of like they use in an article with an integrated youtube video, or just remove the line, since it does not benefit the reader).

Removing the sentence should not be that hard (like when the html is retrieved, set a parameter like "javascript = 'Please turn on JavaScript. Media re...etc...' ". then insert some command like "if sentence "javascript" has been found, then delete it."

after it's deleted you can convert the remaining html to lrf.

I mean I hope you get the general idea...
ProDigit is offline   Reply With Quote
Old 11-19-2008, 01:47 PM   #757
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: 45,353
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
which feed gives you this message?
kovidgoyal is online now   Reply With Quote
Old 11-19-2008, 04:18 PM   #758
ProDigit
Karmaniac
ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.ProDigit ought to be getting tired of karma fortunes by now.
 
Posts: 2,553
Karma: 11499146
Join Date: Oct 2008
Location: Miami FL
Device: PRS-505, Jetbook, + Mini, +Color, Astak Ez Reader Pro, PPW1, Aura H2O
I'm sorry, not CNN, but BBC news has the lines.

I don't know if it's happening to someone else too, but occasionally I get a reader reboot when opening one rss feed after another (eg like I did now, opening Daily Telegraph after BBC.
It reboots when formatting the book.
I don't know if it has anything to do with badly downloaded books, since I'm on a wifi connection and occasionally this connection has hiccups.
ProDigit is offline   Reply With Quote
Old 01-14-2009, 07:47 PM   #759
yargoflick
Enthusiast
yargoflick is on a distinguished road
 
yargoflick's Avatar
 
Posts: 31
Karma: 60
Join Date: Mar 2007
Device: Sony Reader
Just noticed that epub2lrf is ignoring the epub's page breaks and reprocessing the html for breaks.

I had used CSS in the original html to give 'H[1234]' tags a 'page-break-before: always' style. This made a nice epub appropriately split at each header, but when I used epub2lrf on that epub the resulting lrf only had page breaks on the headers that contained the magic word "book". I can force epub2lrf to split at all headers with the --force-page-break-before-tag="h[1234]" option, but I'm thinking epub2lrf should take it's splitting cues from the epub layout.

I have also used <br style="page-break-before: always;" /> tags in the original html to force page breaks in some unheadered spots. These work fine for producing the desired break in the epub, but the break is lost when converting that epub to lrf. Same issue really.

I can still use the original htmls to produce lrfs with the correct page-breaks, but I was hoping to ditch the original htmls and just keep the epubs around as my final source....that's the plan anyway.

Maybe epub2lrf could have a flag that ignores all chapter detection and just splits where the epub splits?

Cheers,
Lee
yargoflick is offline   Reply With Quote
Old 01-14-2009, 07:50 PM   #760
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: 45,353
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The problem isn't that html2lrf is ignoring the page breaks, it's that it cant parse advanced css selectors. So if you used

h1 {page-break...}
h2 {page-break...}
h3 {page-break...}
etc

it would still work
kovidgoyal is online now   Reply With Quote
Old 01-14-2009, 08:12 PM   #761
yargoflick
Enthusiast
yargoflick is on a distinguished road
 
yargoflick's Avatar
 
Posts: 31
Karma: 60
Join Date: Mar 2007
Device: Sony Reader
I think I worded it wrong.

My html files css had:
h1, h2, h3, h4 { page-break-before: always; }

From that html I can create an lrf and an epub with correct page-breaks.

But, if I run epub2lrf on that epub, which itself has correct page-breaks, the resulting lrf will have incorrect page-breaks (only breaks when it finds the "chapter detection words" in the headers).

I'll attach example files.
The lrf was generated from the epub. The epub breaks at each chapter, but the lrf only breaks on chapter headers that contain "book".

Cather, Willa - One Of Ours.epub

Cather, Willa - One Of Ours.lrf
yargoflick is offline   Reply With Quote
Old 01-14-2009, 08:40 PM   #762
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: 45,353
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Looks like a bug, opena ticket and attach the files so I dont forget to address it
kovidgoyal is online now   Reply With Quote
Old 01-14-2009, 09:32 PM   #763
yargoflick
Enthusiast
yargoflick is on a distinguished road
 
yargoflick's Avatar
 
Posts: 31
Karma: 60
Join Date: Mar 2007
Device: Sony Reader
Quote:
Originally Posted by kovidgoyal View Post
Looks like a bug, opena ticket and attach the files so I dont forget to address it
Umm.. sorry about this, not a bug, I just didn't quite get it and made a mess of things.

I didn't disable automatic chapter detection.
There were headers that had the keyword "book" in them so auto chapter detection was triggered and non-keyword headers were treated as non-chapters. Makes perfect sense.

I've got it working fine now.
Cheers.
yargoflick is offline   Reply With Quote
Old 01-19-2009, 05:36 PM   #764
yargoflick
Enthusiast
yargoflick is on a distinguished road
 
yargoflick's Avatar
 
Posts: 31
Karma: 60
Join Date: Mar 2007
Device: Sony Reader
Scratch that, doesn't work.
Filed a ticket with html, epub, and lrf files that show the problem.
Looks like the class="chapter", and style="page-break-before: always;" tag attributes are being honored when creating the epub, but are stripped from the epub's html. Thus, when I go to make the lrf from the epub I don't get the page-breaks.
yargoflick is offline   Reply With Quote
Old 01-22-2009, 12:10 AM   #765
sauravishal
Junior Member
sauravishal began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2008
Device: none
is there any the best possible way to convert pdf into mobipocket files (.prc)...exact as same as the pdf...
sauravishal is offline   Reply With Quote
Reply

Tags
html2lrf, libprs500


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 05:54 AM.


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