![]() |
#1 |
curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
|
![]()
I tried using Scotty's java-based converter, with decent results. But... What I'm really trying to do is to produce usable documents for issues of Jim Baen's Universe (interested readers should check out http://www.baensuniverse.com ).
They make the files available for download in a variety of formats, including .rtf and .html, but I haven't found a way to produce a truly readable version for the PRS500. The .rtf works fine, but you lose the pictures, and don't have any access to a ToC. And with ~1000-page files that include a dozen or more stories and columns, you really really need some built-in navigation. So I moved on to trying to convert .html for the PRS500. One of the download options is an html file that includes all the text in one big file (with internal navigation), and that has the artwork in a sub-directory. Scotty's converter does a good job with the text, but loses the navigation links and the artwork. Now what do I do? Xenophon ![]() |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,231
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You could try writing a converter yourself. You can use Falstaff's LRF python library to generate the lrf files. Python has plenty of modules that can serve as a base for an HTML parser. If you ignore CSS, it shouldn't be too hard. It's something I keep meaning to get around to doing, but I lack motivation as I don't read any books that require internal navigation on my reader.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,231
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I've implemented a pure python html->lrf converter that should be able to handle this its in the libprs500 svn accessed via the command html2lrf. It needs testing so let me know if it chokes and I'll fix it.
|
![]() |
![]() |
![]() |
#4 |
curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
|
The conversion ran successfully on one of the html files I'm interested in. When I tried adding it to my library (in prs500-gui) I got the following error:
Code:
There was an error calling add_books Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500-0.3.13-py2.5.egg/libprs500/gui/main.py", line 56, in function return func(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500-0.3.13-py2.5.egg/libprs500/gui/main.py", line 216, in add_books self.library_view.model().add_book(_file) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500-0.3.13-py2.5.egg/libprs500/gui/widgets.py", line 654, in add_book _id = self.db.add_book(path) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500-0.3.13-py2.5.egg/libprs500/gui/database.py", line 64, in add_book mi = get_metadata(open(_file, "r+b"), ext) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500-0.3.13-py2.5.egg/libprs500/metadata/meta.py", line 24, in get_metadata return lrf_metadata(stream) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500-0.3.13-py2.5.egg/libprs500/lrf/meta.py", line 196, in get_metadata mi = MetaInformation(lrf.title.strip(), lrf.author.strip()) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500-0.3.13-py2.5.egg/libprs500/lrf/meta.py", line 105, in __get__ document = dom.parseString(obj.info) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/dom/minidom.py", line 1923, in parseString return expatbuilder.parseString(string) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/dom/expatbuilder.py", line 940, in parseString return builder.parseString(string) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/dom/expatbuilder.py", line 223, in parseString parser.Parse(string, True) ExpatError: unclosed token: line 19, column 7 Xenophon |
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,231
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Looks like a problem with the metadata block. Does it work in the connect software LRF viewer? What does
Code:
lrf-meta --get-thumbnail your_file.lrf Code:
prs500 cp your_file.lrf prs500:/Data/media/books Last edited by kovidgoyal; 04-23-2007 at 12:06 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,487
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
|
The document appears to work fine on the reader, in the sense that it does not cause crashes, and I seem to be able to read the text. I have no idea how it appears in the Connect Software, as I have no Windows box to run it on.
I'll be happy to send you the lrf file for debugging. Expect an email sometime this evening. Would it help to get the original html as well? Xenophon |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,231
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yeah the HTML file would be helpful. Thanks.
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,231
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The LRF file worked for me. Adding it to the library didn't cause any problems. I think this has to do with differences in the way garbage collection of open file objects works in OSX. I've implemented a possible fix in svn. To check could you run the lrf-meta command on your LRF file. That should work even with the code you have.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Useful Applescript for Mac OS X users | pdurrant | Kindle Formats | 11 | 07-23-2011 05:00 AM |
Mac users that are Reader owners, help a new Mac owner | AnemicOak | Sony Reader | 8 | 06-12-2010 04:36 PM |
Seriously thoughtful How many Mac users on this site? | mwheinz | Lounge | 18 | 10-22-2009 09:16 AM |
CBZ > LRF (LRF>HTML/MOBI????) | sideburnt | Calibre | 4 | 09-15-2009 06:44 AM |
Question for mac users | jerryleejr | Sony Reader | 6 | 02-06-2008 12:59 AM |