Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Sony Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 12-26-2008, 08:53 AM   #46
AprilHare
Wizard
AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.
 
AprilHare's Avatar
 
Posts: 2,981
Karma: 11862367
Join Date: Apr 2008
Device: Sony Reader PRS-T2
OK: I downloaded FangornUK's script and tried it. Other then it complaining it couldn't find perl (the first line in the script appeared to have ^M next to it; fixed by editing with gedit) I get the following error:
Quote:
Can't locate Archive/Zip.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./gutlrf.pl line 17.
BEGIN failed--compilation aborted at ./gutlrf.pl line 17.
AprilHare is offline   Reply With Quote
Old 12-26-2008, 09:13 AM   #47
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
You have to install Zip.pm in some way. Either using a package in your distribution or using CPAN (e.g. "perl -MCPAN -e shell").
tompe is offline   Reply With Quote
Advert
Old 12-26-2008, 02:00 PM   #48
pilotbob
Grand Sorcerer
pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.
 
pilotbob's Avatar
 
Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by AprilHare View Post
OK: I downloaded FangornUK's script and tried it. Other then it complaining it couldn't find perl (the first line in the script appeared to have ^M next to it; fixed by editing with gedit) I get the following error:
Yes, alot of the .py scripts you will find out there have CRLF line endings which Mac/Linux doesn't like. You should convert to LF only.

BOb
pilotbob is offline   Reply With Quote
Old 01-06-2009, 08:11 AM   #49
AprilHare
Wizard
AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.
 
AprilHare's Avatar
 
Posts: 2,981
Karma: 11862367
Join Date: Apr 2008
Device: Sony Reader PRS-T2
Very good, finally got the script going:
Of course, it didn't have to be all fair sailing and here is the output from my first conversion:
Quote:
:~/Desktop/untitled folder/CleanMe!!!/gutlrf$ ./gutlrf.pl http://www.gutenberg.org/files/17297/17297-h.zip
... 0KBytes

Extracting files...

Book Title: British Highways And Byways From A Motor Car
Author : Thomas D Murphy

Cleaning HTML...
Wrote cleaned HTML "/tmp/17297-h/new.htm"
Converting to BBeB...
Processing u'new.htm'
Parsing HTML...
Converting to BBeB...
An error occurred while processing a table: AttributeError("'module' object has no attribute 'tt0011m_'",). Ignoring table markup.
An error occurred while processing a table: AttributeError("'module' object has no attribute 'tt0011m_'",). Ignoring table markup.
Rationalizing font sizes...
Output written to /tmp/17297-h/British Highways And Byways From A Motor Car.lrf
Segmentation fault
Died at ./gutlrf.pl line 261.
Attached Files
File Type: lrf British Highways And Byways From A Motor Car.lrf (2.20 MB, 363 views)

Last edited by AprilHare; 01-06-2009 at 08:14 AM. Reason: Attaching output LRF
AprilHare is offline   Reply With Quote
Old 01-06-2009, 10:33 AM   #50
FangornUK
Addict
FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.
 
FangornUK's Avatar
 
Posts: 205
Karma: 317
Join Date: Oct 2006
Location: England
Device: Sony PRS-505, iPad, Kindle 3
No idea, that book conversion works fine for me (coincidentally one of my favourites).
gutlrf.pl 17297
Your error is coming from Calibre, make sure you've installed the latest version and have all the dependencies Calibre requires (as I assume you're on Unix).

P.S. I've updated the gutlrf.pl to be in Unix/OSX text type so it doesn't have the ^M problems, will also work fine on Windows.

Last edited by FangornUK; 01-06-2009 at 10:41 AM.
FangornUK is offline   Reply With Quote
Advert
Old 01-06-2009, 12:07 PM   #51
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: 44,255
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
the table error is fixed in 125
kovidgoyal is offline   Reply With Quote
Old 01-06-2009, 10:19 PM   #52
AprilHare
Wizard
AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.
 
AprilHare's Avatar
 
Posts: 2,981
Karma: 11862367
Join Date: Apr 2008
Device: Sony Reader PRS-T2
Kovid, I had 125 installed. I'll upgrade to 126 and the latest gutlrf and see what happens.
I'm using Ubuntu 8.10 Intrepid Ibex AMD64.
AprilHare is offline   Reply With Quote
Old 01-06-2009, 10:35 PM   #53
AprilHare
Wizard
AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.
 
AprilHare's Avatar
 
Posts: 2,981
Karma: 11862367
Join Date: Apr 2008
Device: Sony Reader PRS-T2
OK; the new script behaved differently, with 126 and the latest gutlrf.pl:
The contents links all point to page one according to LRF viewer.
Output:
Quote:
:~/Desktop/untitled folder/CleanMe!!!/gutlrf$ ./gutlrf.pl http://www.gutenberg.org/files/17297/17297-h.zip
Extracting files...

Book Title: British Highways And Byways From A Motor Car
Author : Thomas D Murphy

Cleaning HTML...
Wrote cleaned HTML "/tmp/17297-h/new.htm"
Converting to LRF BBeB...
Processing u'new.htm'
Parsing HTML...
Converting to BBeB...
Rationalizing font sizes...
Output written to /tmp/17297-h/British Highways And Byways From A Motor Car.lrf
Segmentation fault
Died at ./gutlrf.pl line 261.
Attached Files
File Type: lrf British Highways And Byways From A Motor Car.lrf (2.24 MB, 404 views)
AprilHare is offline   Reply With Quote
Old 01-06-2009, 11:34 PM   #54
AprilHare
Wizard
AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.
 
AprilHare's Avatar
 
Posts: 2,981
Karma: 11862367
Join Date: Apr 2008
Device: Sony Reader PRS-T2
I opened new.htm with Amaya 9.5.5 and it gave me the following:
Quote:
*** Errors/warnings in /tmp/17297-h/new.htm
line 6, char 0: Invalid or unsupported XHTML element <META>
line 7, char 0: Invalid or unsupported XHTML element <META>
line 82, char 4: mismatched tag
Line 82 refers to a errant </head>

Last edited by AprilHare; 01-07-2009 at 12:04 AM.
AprilHare is offline   Reply With Quote
Old 02-09-2009, 11:29 AM   #55
FangornUK
Addict
FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.
 
FangornUK's Avatar
 
Posts: 205
Karma: 317
Join Date: Oct 2006
Location: England
Device: Sony PRS-505, iPad, Kindle 3
Updated:
  • Now process etext by paragraph "<p>" to catch split lines more documents appear to be using.
  • Improved detection of HTML markup

Download it from the link on the first post of this topic.
FangornUK is offline   Reply With Quote
Old 02-21-2009, 03:05 PM   #56
Alpharesearch
Junior Member
Alpharesearch began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2009
Device: PRS-505
license question

Hello FangornUK,

first thank you for your Perl script... I added two lines and now the script also creates ePUB files:

Code:
$lrfbook=File::Spec->catfile($outdir, "$BOOKTITLE.lrf");
$epubbook=File::Spec->catfile($outdir, "$BOOKTITLE.epub");
#Everything setup so create the actual LRF BBeB book
system ("html2lrf \"$outfile\" -t \"$BOOKTITLE\" -a \"$AUTHOR\" --category=\"Project Gutenberg\" -o \"$lrfbook\" --disable-chapter-detection --left-margin=25 --right-margin=25 --link-exclude=http:") == 0 || die $!;
system ("html2epub \"$outfile\" -t \"$BOOKTITLE\" -a \"$AUTHOR\" --publisher=\"Project Gutenberg\" -o \"$epubbook\" --profile=PRS505") == 0 || die $!;
What license does your script uses GNU GPL? I have not problem to put my change under GPL... I'm asking because I found a bug in html2epub and I would like to attach your script for reproduction to the bug tracer...

With the Calibre viewer look at PG book 201, the ASCII art looks good in ePUB but not so good in LRF... but there is a bug in the second half of the ePUB book... just scroll down.

the original html form PG
Code:
[ASCII approximation follows]
</H3>

<BR>

<PRE>
                           My view of Lineland

                                ---------
                                |       |
                                | Myself|
                                |       |
                        My eye  o--------


   Women  A boy       Men        The KING        Men       A boy  Women
  + + + +   -   --- -- -- -- --  (>----<)  -- -- -- -- ---   -   + + + +
                                  ^    ^
                                The KING'S eyes
                                much larger than the reality
                                shewing that HIS MAJESTY
                                could see nothing but a point.
</PRE>

<BR>

<P>
"I am no Woman,"
in ePUB some Text and a </PRE> is missing...
Code:
[ASCII approximation follows] 
</h3> 
 
<p style="margin: 0pt; border:0pt; height:0pt">Â*</p><pre> 
                           My view of Lineland 
 
                                --------- 
                                |       | 
                                | Myself| 
                                |       | 
                        My eye  o-------- 
 
 
   Women  A boy       Men        The KING        Men       A boy  Women 
  + + + +   -   --- -- -- -- --  (&gt;---- 
 
<br/><p> 
"I am no Woman," replied the small Line.
Thanks,
Markus

Last edited by Alpharesearch; 02-21-2009 at 03:13 PM.
Alpharesearch is offline   Reply With Quote
Old 02-22-2009, 02:55 PM   #57
FangornUK
Addict
FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.
 
FangornUK's Avatar
 
Posts: 205
Karma: 317
Join Date: Oct 2006
Location: England
Device: Sony PRS-505, iPad, Kindle 3
There's no license. I can easily add the ePub output as an option. I have a PRS500 so it doesn't support ePub and I assumed LRF and ePub output would be the same so I would have sticked with the native LRF.
FangornUK is offline   Reply With Quote
Old 02-22-2009, 04:08 PM   #58
Alpharesearch
Junior Member
Alpharesearch began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2009
Device: PRS-505
Thanks

Quote:
Originally Posted by FangornUK View Post
There's no license. I can easily add the ePub output as an option. I have a PRS500 so it doesn't support ePub and I assumed LRF and ePub output would be the same so I would have sticked with the native LRF.
ePUB seams to preserves the ASCII art (for example the PG 201 book). To me it also feels like it loads faster than the LRF on the PRS505. It would be nice if you could add a switch to your script for ePUB, thanks.

Markus
Alpharesearch is offline   Reply With Quote
Old 02-22-2009, 08:33 PM   #59
FangornUK
Addict
FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.
 
FangornUK's Avatar
 
Posts: 205
Karma: 317
Join Date: Oct 2006
Location: England
Device: Sony PRS-505, iPad, Kindle 3
gutlrf strips out the <pre> sections as I've only seen the Gutenberg disclaimer in that section before. That needs a bit of work.

ePub is still not quite mature on the PRS-505 (no right justification) so I personally would stick with LRF for now. ePub looks to be the future though and has better formatting than LRF, nice inline image support etc.

I also do not know what ePub looks like on the PRS-505, it looks great on the Calibre Viewer, but that's not exactly the same as the PRS-505.

Last edited by FangornUK; 02-22-2009 at 08:40 PM.
FangornUK is offline   Reply With Quote
Old 05-01-2009, 10:15 AM   #60
FangornUK
Addict
FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.FangornUK has a complete set of Star Wars action figures.
 
FangornUK's Avatar
 
Posts: 205
Karma: 317
Join Date: Oct 2006
Location: England
Device: Sony PRS-505, iPad, Kindle 3
Updated:
  • Now can also output ePub files as well as LRF.

Finally I've upgraded my PRS-500 to a PRS-505 so now I can read ePub files (also the battery was dying). I recommend converting Gutenberg HTML files in ePub format as it supports inline image display - much better than LRF files.


Download it from the link on the first post of this topic.
FangornUK is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML from Project Gutenberg? Rcartes Sony Reader 10 04-21-2009 07:26 PM
html to bbeb converter ? bugsbunny14 Sony Reader 10 11-07-2008 10:50 PM
Book Processor - Anything to LRF and HTML converter LittleDragon Sony Reader 11 05-13-2008 04:31 PM
JafSoft AscToRTF - A GREAT Gutenberg Book/Ascii/RTF converter Prince Bertram Sony Reader 11 11-25-2006 06:29 AM
Mazarin - Gutenberg in HTML Alexander Turcic Deals and Resources (No Self-Promotion or Affiliate Links) 0 05-25-2004 03:11 AM


All times are GMT -4. The time now is 06:59 AM.


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