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 10-03-2007, 04:22 PM   #466
aaronvegh
Junior Member
aaronvegh began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2007
Device: None
Oh, that's it! Awesome! Great tool, thanks for your help!
aaronvegh is offline   Reply With Quote
Old 10-04-2007, 07:13 AM   #467
Fallen angel
Time Vortex Manipulator
Fallen angel began at the beginning.
 
Fallen angel's Avatar
 
Posts: 30
Karma: 10
Join Date: Aug 2007
Location: Greece
Device: Sony Reader
Quote:
Originally Posted by kovidgoyal View Post
Hmm ok I'm trying another fix in the next version.
Thank you very much!
Fallen angel is offline   Reply With Quote
Old 10-04-2007, 01:35 PM   #468
maggotb0y
Connoisseur
maggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheese
 
Posts: 84
Karma: 1166
Join Date: Apr 2007
Location: New Jersey, Outside of Philadelphia
Device: Sony Reader
Converting BD files

Hey, I've been using Book Designer for a while to create Sony Reader Content, and I think it's a nice program, but it looks like I'll get better results with html2lrf for inline graphics and tables, etc. I'd like to be able to convert my HTML0 files output by BD using libprs500, and I'm having a few problems. I've looked around and was a bit surprised that this doesn't seem to have come up on the forum.

Here are my questions.

I can't figure out a chapter-regex that will pick up BD style chapter tags (I've included an example below). Can anyone help me with that?

<SPAN id=title><DIV align=center><B><FONT color=#001950>PROLOGUE</FONT></B></DIV>
</SPAN>

Another issue is trying to get page breaks to work the way I want. BD replaces the <HR> tag with page breaks, and I use that to control pagination (BD by default also does chapter page breaks, but I turn that off so that I can have more control over the output). With libprs500, I can use page-break-before-tag=HR and that controls the page break fine, but it displays the Horizontal Rule, which I don't want. Is there any workaround that would create the manual page break, but not include the visible line?

Finally (for now at least), BD creates empty lines as
<DIV align=justify>&nbsp;&nbsp;&nbsp;&nbsp;</DIV>
and HTML2LRF seems to not respect that empty line- the line below is pushed up. Is there any way I can force this to show as an empty line.
maggotb0y is offline   Reply With Quote
Old 10-04-2007, 01:45 PM   #469
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,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm none of those issues have easy solutions. What I will do is make a preprocessing option for BD that will automatically replace the problematic html with HTML that html2lrf processes. Can you send me a couple of example HTML0 files.

Also you may try saving the HTML0 files as HTML in BD and then running html2lrf over them.
kovidgoyal is offline   Reply With Quote
Old 10-04-2007, 03:10 PM   #470
maggotb0y
Connoisseur
maggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheese
 
Posts: 84
Karma: 1166
Join Date: Apr 2007
Location: New Jersey, Outside of Philadelphia
Device: Sony Reader
BD Content

Quote:
Originally Posted by kovidgoyal View Post
Hmm none of those issues have easy solutions. What I will do is make a preprocessing option for BD that will automatically replace the problematic html with HTML that html2lrf processes. Can you send me a couple of example HTML0 files.

Also you may try saving the HTML0 files as HTML in BD and then running html2lrf over them.
A pre-processing engine for BD would probably make quite a bit of sense. The only difference between the "html0" file and the "save as HTML" options in BD is the name of the extension <g>.

I've attached a zip file with an HTML file generated from BD that will give you the basics. I'm sure it is pretty self explanatory, but if you have any questions, let me know. If you need some bigger files for a more complete test, let me know and I will see if I have anything public domain with some good formatting to post.
Attached Files
File Type: zip test.zip (667 Bytes, 247 views)

Last edited by maggotb0y; 10-04-2007 at 09:24 PM.
maggotb0y is offline   Reply With Quote
Old 10-04-2007, 07:30 PM   #471
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,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm tell me if the following mapping is correct
<span id=title> --> <h1>
<span id=subtitle> --> <h2>
What about lower levels of headings? subsubtitle, etc?
That way you can match chapters on either h1 or h2.

<hr> --> <span style="page-break-after:always" />

I will probably modify html2lrf's handling of the div tag to take care of the blank lines.

Incidentally, the way BD uses the id attribute is puzzling. According to the HTML spec ids should be unique, is there some reason vvv chose to use the id attribute rather than the class attribute, which is a much more natural fit?
kovidgoyal is offline   Reply With Quote
Old 10-04-2007, 09:22 PM   #472
maggotb0y
Connoisseur
maggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheese
 
Posts: 84
Karma: 1166
Join Date: Apr 2007
Location: New Jersey, Outside of Philadelphia
Device: Sony Reader
Quote:
Originally Posted by kovidgoyal View Post
Hmm tell me if the following mapping is correct
<span id=title> --> <h1>
<span id=subtitle> --> <h2>
What about lower levels of headings? subsubtitle, etc?
That way you can match chapters on either h1 or h2.
Looks almost right- book designer always creates a chapter for <span id=title> and never creates one for <span id=subtitle>. I use this to create a title for (e.g. "A funny thing happened today") but not for the subtitle ("chapter one") so that I have control over what appears in the table of contents. I doubt you would have to do much special handling for span id=subtitle, they will probably take care of themselves just fine.

Quote:
Originally Posted by kovidgoyal View Post
Incidentally, the way BD uses the id attribute is puzzling. According to the HTML spec ids should be unique, is there some reason vvv chose to use the id attribute rather than the class attribute, which is a much more natural fit?
Not really sure why BD is the way it is <g>. It's a nice enough tool for creating ebooks, but it has it's quirks, and the pace of development and featureset of libprs500 seems to far outstrip BD (which is why I would like to make the switch).

Thanks a lot for your work on this, I'm sure you'll earn quite a few converts. Let me know when you have something ready for testing- I'm excited to start running my collection through this!
maggotb0y is offline   Reply With Quote
Old 10-04-2007, 10:17 PM   #473
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: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
If anyone wants to donate to get kividgoyal a new 505 so he can port libprs500 to it then please have a look at https://www.mobileread.com/forums/showthread.php?t=14496 and give give give.
JSWolf is offline   Reply With Quote
Old 10-04-2007, 11:16 PM   #474
glenn69
Junior Member
glenn69 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2007
Device: prs500
I'm having trouble converting html

I've been trying for a couple weeks to get a website page to lrf format using libprs500 in Linux (ubuntu). The page is simply a text handbook, so I thought it would be simple.

Well it hasn't really worked for me yet. i've tried saving html converting to pdf then pdf2lrf, no go. Tried html2lrf, again no good.

Could somebody convert show me how to convert this page :
http://www.gentoo.org/doc/en/handboo...l=1#book_part1

Then let me know how you did it.

Thanks,

One Confused Reader
glenn69 is offline   Reply With Quote
Old 10-05-2007, 07:17 AM   #475
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,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
When you say no good, what do you mean exactly? The simplest way to convert an online website into an LRF file is

web2lrf --url "http://www.gentoo.org/doc/en/handboo...l=1#book_part1"

EDIT: In your case the correct commandline is web2lrf --url "http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?style=printable&full=1#book_part1" -r 0

Last edited by kovidgoyal; 10-05-2007 at 07:33 AM.
kovidgoyal is offline   Reply With Quote
Old 10-05-2007, 04:10 PM   #476
glenn69
Junior Member
glenn69 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2007
Device: prs500
I'm sorry for the lack of detail with "no good," but I've tried so many times that I've forgotten exact problems.

I ran the command exactly as you suggested
web2lrf --url "http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?style=printable&full=1#book_part1" -r 0

When I try to view in Sony reader, upon opening the file, it either hangs on "Formatting..." or it reboots the unit.

So,I tried to use lrfviewer to view the created lrf. Below are my errors upon viewing:

Quote:
glenn@glenn-desktop:~$ lrfviewer /home/glenn/GentooDocNoTable.lrf
glenn@glenn-desktop:~$ Layout time: 8.56640505791 seconds
Traceback (most recent call last):
File "build/bdist.linux-i686/egg/libprs500/gui2/lrf_renderer/main.py", line 180, in go_to_page
File "build/bdist.linux-i686/egg/libprs500/gui2/lrf_renderer/document.py", line 509, in show_page
TypeError: argument 0 of signal QGraphicsScene.page_changed(PyQt_PyObject) has an invalid type

Traceback (most recent call last):
File "build/bdist.linux-i686/egg/libprs500/gui2/lrf_renderer/main.py", line 180, in go_to_page
File "build/bdist.linux-i686/egg/libprs500/gui2/lrf_renderer/document.py", line 509, in show_page
TypeError: argument 0 of signal QGraphicsScene.page_changed(PyQt_PyObject) has an invalid type

Traceback (most recent call last):
File "build/bdist.linux-i686/egg/libprs500/gui2/lrf_renderer/main.py", line 180, in go_to_page
File "build/bdist.linux-i686/egg/libprs500/gui2/lrf_renderer/document.py", line 509, in show_page
TypeError: argument 0 of signal QGraphicsScene.page_changed(PyQt_PyObject) has an invalid type
Thanks for help and all your efforts on this great project.

Last edited by glenn69; 10-05-2007 at 04:16 PM.
glenn69 is offline   Reply With Quote
Old 10-05-2007, 07:32 PM   #477
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,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This is because the PyQt on your distribution is not correctly installed. The LRF file should work fine if you copy it to the SONY reader or view it using the Connect software.
kovidgoyal is offline   Reply With Quote
Old 10-05-2007, 10:32 PM   #478
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,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by maggotb0y View Post
Looks almost right- book designer always creates a chapter for <span id=title> and never creates one for <span id=subtitle>. I use this to create a title for (e.g. "A funny thing happened today") but not for the subtitle ("chapter one") so that I have control over what appears in the table of contents. I doubt you would have to do much special handling for span id=subtitle, they will probably take care of themselves just fine.


Not really sure why BD is the way it is <g>. It's a nice enough tool for creating ebooks, but it has it's quirks, and the pace of development and featureset of libprs500 seems to far outstrip BD (which is why I would like to make the switch).

Thanks a lot for your work on this, I'm sure you'll earn quite a few converts. Let me know when you have something ready for testing- I'm excited to start running my collection through this!
Added initial support for pre-processing via the --book-designer option in svn.
kovidgoyal is offline   Reply With Quote
Old 10-05-2007, 11:03 PM   #479
glenn69
Junior Member
glenn69 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2007
Device: prs500
According to Synaptic I have the following pyqt's installed:

Python-qt3
Python-qt4
Python-qt4-dev
Python-qt4-gl
Python-qt4-sql

Is there something else I need ?
glenn69 is offline   Reply With Quote
Old 10-05-2007, 11:12 PM   #480
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,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's a version problem. You should either install SPI and PyQt by hand or wait for gutsy.
kovidgoyal 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 03:09 AM.


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