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 05-10-2007, 10:05 PM   #1
jimmyzou
Connoisseur
jimmyzou began at the beginning.
 
jimmyzou's Avatar
 
Posts: 96
Karma: 11
Join Date: Jul 2006
Location: Montreal
Device: Sony Reader; Kobo; Nook color
How to deal with CHM?

I have some files in CHM format, how to convert it into LRF?
jimmyzou is offline   Reply With Quote
Old 05-10-2007, 10:13 PM   #2
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
In the command prompt execute:

hh -decompile <path to .chm> <directory where to put html files>

Then just convert the html files using BookDesigner or html2lrf.
You can also use one of the hundreds of fancy CHM decompilers to get the HTML.
igorsk is offline   Reply With Quote
Advert
Old 05-11-2007, 12:55 AM   #3
jimmyzou
Connoisseur
jimmyzou began at the beginning.
 
jimmyzou's Avatar
 
Posts: 96
Karma: 11
Join Date: Jul 2006
Location: Montreal
Device: Sony Reader; Kobo; Nook color
Thanks, igorsk.
Seems I need really take time to learn how to use BD....
jimmyzou is offline   Reply With Quote
Old 05-11-2007, 04:08 AM   #4
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
On a related note, do you (or anyone else) know of any good way to create an LRF file from a "collection" of HTML files - ie the sort of document where (for example) one has a book that consists of a "Contents" page which has links to each chapter; each chapter being a separate HTML file?
HarryT is offline   Reply With Quote
Old 05-11-2007, 04:54 AM   #5
AndyQ
Enthusiast
AndyQ began at the beginning.
 
Posts: 38
Karma: 36
Join Date: Dec 2006
Device: Sony Reader PRS-500
Well, there is a program HTMLDoc which can convert multiple html pages into a PDF which you could then convert to an LRF.

The current versions of HTMLDoc are shareware but an older version (which is freeware) can be found at http://fresh.t-systems-sfr.com/pc/src/www/old/
AndyQ is offline   Reply With Quote
Advert
Old 05-11-2007, 06:01 AM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Thanks for the suggestion Andy.

I'm really not a fan of PDF. Anyone know of anything which will convert to some more "friendly" format such as a single HMTL page? RTF?
HarryT is offline   Reply With Quote
Old 05-11-2007, 07:33 AM   #7
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,463
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by HarryT
On a related note, do you (or anyone else) know of any good way to create an LRF file from a "collection" of HTML files - ie the sort of document where (for example) one has a book that consists of a "Contents" page which has links to each chapter; each chapter being a separate HTML file?
I usually take the index.html (TOC) file and edit it so only the list of files that are referenced is retained- all in perfect order.
This can be done like this
load file in vim editor
remove all linebreaks :%s/\n//
insert linebreaks before all < characters :%s/</{here press ctrl+Q Enter}</g
insert linebreaks after all > characters :%s/>/>{here press ctrl+Q Enter}/g
remove all lines not containing <a href= tag :v/<a href/delete
remove all <a href="http:// tags themselves :%s/<a href="
remove all > tags :%s/">//

You can even make script file
strip_names.vim
" beginning of the script
:%s/\n//
:%s/</{here press ctrl+Q Enter}</g
:%s/>/>{here press ctrl+Q Enter}/g
:v/<a href/delete
:%s/<a href="
:%s/">//
" end of the script

and you call the script by typing
:source strip_names.vim
on the commandline of the Vim editor

Then I take this list and convert it to a script like
cat chapter1.html >> all_of_them.html
cat chapter2.html >> all_of_them.html
and run the script

as an alternative the script all_of_them.vim
can look like
:$read chapter1.html
:$read chapter2.html

then you open an empty file all_of_them.html in Vim
and run the script
:source all_of_them.vim

Now you transform resulting monster html document all_of_them.html to rtf by loading it into your favourite word processor and saving it into rtf or using html2rtf, or by running a vim script that converts chosen html tags to rtf tags and inserts an rtf "header" and "footer" - this way you can retain bold and itallic tags and nuke all others

Then you can procede to transform rtf file into lrf using your favourite tools.
I usually do not bother converting and load rtf file directly into Reader via memory card.

For Vim editor for your favourite operating system (including QNX, AmigaOS or VMS among numerous others) see www.vim.org
kacir is offline   Reply With Quote
Old 05-11-2007, 10:23 AM   #8
Azayzel
Cache Ninja!
Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.Azayzel ought to be getting tired of karma fortunes by now.
 
Azayzel's Avatar
 
Posts: 643
Karma: 1002300
Join Date: Jan 2007
Location: Tokyo, Japan
Device: PRS-500, HTC Shift, iPod Touch, iPaq 4150, TC1100, Panasonic WordsGear
Thumbs up

Quote:
Originally Posted by igorsk
In the command prompt execute:

hh -decompile <path to .chm> <directory where to put html files>

Then just convert the html files using BookDesigner or html2lrf.
You can also use one of the hundreds of fancy CHM decompilers to get the HTML.
I had no idea BD could do this, that's friggin awesome! Thanks for the command line parameters. I've been using my PDA for viewing CHM's up until now,guess I'll have to give it a go and see how they turn out. My intial thought experiments on this had me running the CHM through a decompiler and then converting the HTML, but I thought I'd have to fish one up myself, guess I was wrong.

Thanks again for the info igorsk!
Azayzel is offline   Reply With Quote
Old 05-11-2007, 01:20 PM   #9
jimmyzou
Connoisseur
jimmyzou began at the beginning.
 
jimmyzou's Avatar
 
Posts: 96
Karma: 11
Join Date: Jul 2006
Location: Montreal
Device: Sony Reader; Kobo; Nook color
Quote:
Originally Posted by kacir
I usually take the index.html (TOC) file and edit it so only the list of files that are referenced is retained- all in perfect order.
This can be done like this
load file in vim editor
remove all linebreaks :%s/\n//
insert linebreaks before all < characters :%s/</{here press ctrl+Q Enter}</g
insert linebreaks after all > characters :%s/>/>{here press ctrl+Q Enter}/g
remove all lines not containing <a href= tag :v/<a href/delete
remove all <a href="http:// tags themselves :%s/<a href="
remove all > tags :%s/">//
...........

Thanks a lot...
Wow, it is really like lot of work... Especailly for a people like me, I really have not been doing programing for many years, so these kinda too complex for me...
jimmyzou is offline   Reply With Quote
Old 05-11-2007, 02:34 PM   #10
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,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by HarryT
On a related note, do you (or anyone else) know of any good way to create an LRF file from a "collection" of HTML files - ie the sort of document where (for example) one has a book that consists of a "Contents" page which has links to each chapter; each chapter being a separate HTML file?
html2lrf
kovidgoyal is offline   Reply With Quote
Old 05-12-2007, 05:32 AM   #11
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,463
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by jimmyzou
Thanks a lot...
Wow, it is really like lot of work... Especailly for a people like me, I really have not been doing programing for many years, so these kinda too complex for me...
Vim has relatively steep learning curve, but it is well worth learning.
Those commands DO look cryptic, I know, but you should give it a try. Download gvim - a gui version of vim.
The most used command in my examples is
:s
That is just a short form of
:substitute
command

For replacing 'foo' with 'bar' on the current line it works like this:
you press <Esc> key to get into command line. Command line is at the bottom of the screen and begins with ':'
then you type
:substitute/foo/bar/

If you want to substitute 'foo' with 'bar' on all lines of file you have to give he substitute command an address.
You could type "apply the substitute command on lines in range from line 1 [represented by number 1] to the last line [you do not know how many lines the file has, so the representation for the last line is $ character]"
Uf. That is a loooong command isn't it?
We would write it like this
press <Esc> to get to the command line and type
:1,$substitute/foo/bar/g
1,$ - means range of all lines and there is a shortcut '%', so you do not have to type three characters '1,$' to write the most commonly used range .
Also substitute can be shortened to just s command so we get:
:%s/foo/bar/g

Now we get to the letter 'g' at the end of the substitute command. g is the "option" and it means "replace all occurences of 'foo' on the line". Without 'g' option the substitute command would only replace the first 'foo' on the line.

Uffff.

And we haven't even scratched the surface yet.
I didn't even get to the 'Regular expressions' yet.
'foo' in our example is a regular expression meaning letters 'f' 'o' 'o'. but regular expressions can be MUCH more ... aehm ... expressive
see http://www.regular-expressions.info/
Regular expressions in vim are even more powerfull than REs on perl. Yes, I can prove it. Just send me a PM ;-)


This all is only a tip of the iceberg.
besides the :substitute command there are another 1152 commands in vim (yes, I have just counted them in the ':help index' built in documentation) and another 211 built-in functions. Combine THAT with thousands of macros, programs, scripts, tips, configurations and syntax definition files on www.vim.org PLUS a very very friendly community on the mailing list and you get THE most powerfull text editor in the world.
vim also has the best documentation I have *ever* seen. And I am quite keen on software manuals ;-)

You do not have to learn all of these commands. Just
:s comand itself makes vim worth learning.
All you really need is about 10 commands and you can manipulate ANY book in text format to suit your taste.

if you learn Vim you will also automaticaly acquire other skills:
- you will be able to use the infamous vi editor. vi is the default editor on just about any Unix out there. There are countless other editors but vi is the one you find installed on ANY Unix out there
- you will be able to use ed editor - a most minimalistic unix editor you get as the last resort when something really, really bad happens to your Unix (like you screw your /etc/fstab file and your Unix (or Linux, FreeBSD) boots into emergency single user mode
- you will be able to write sed scripts
- you will be able to use grep command in Unix
- you will learn 'Regular expressions' - a really powerfull mini language for manipulating (or describing) strings (text objects) Regular expressions are built into most of the Unix tools (vi, ed, ex, sed, grep, more, less and countless others like for example OpenOffice.org). Regular expressions are built into most of modern programming languages like perl, python, ruby, .....

If you are a Windows user and you hesitate to start using such a complicated and intimidating looking tool as gvim try TextPad - a shareware text editor that has very decent Regular expessions support.
Or try EditPad pro http://www.regular-expressions.info/editpadpro.html


Disclaimer: This is not a flamebait to the [X]Emacs users ;-) I am a converted former XEmacs user myself.
kacir is offline   Reply With Quote
Old 05-12-2007, 01:24 PM   #12
jimmyzou
Connoisseur
jimmyzou began at the beginning.
 
jimmyzou's Avatar
 
Posts: 96
Karma: 11
Join Date: Jul 2006
Location: Montreal
Device: Sony Reader; Kobo; Nook color
Wow, Kacir, thank yo uvery much for writing that lot.
Unfortunately or Fortunately, I' m a windows user, so I will try TextPad and Editpad Pro...

I ever used Ultraedit years ago, is this one also comparablely good?
jimmyzou is offline   Reply With Quote
Old 05-13-2007, 08:51 AM   #13
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,463
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by jimmyzou
Wow, Kacir, thank yo uvery much for writing that lot.
Unfortunately or Fortunately, I' m a windows user, so I will try TextPad and Editpad Pro...

I ever used Ultraedit years ago, is this one also comparablely good?
I have been Windows user since Windows 2.0 version. I use windows at work even now. I need it to run Autocad, CorelDraw and other programs. I am also administrator at the company I work for, so I am a kind of mercenary. I use anything that will get the work done. Windows, Unix, Linux, ... whatever. I even teach MS Office occasionaly ;-)

Choice of operating system, or an editor (here I make fun of Vi versus Emacs war) is not a religion. You simply use what works the best for YOU and what you can afford to pay for (or persuade your boss to buy for you).

I have been using TextPad for many, many years. It is a great editor, packed to the gills with very powerfull features. It also has a very shallow learning curve and suports decent subset of Regular expressions. It is shareware, but it does not expire and has no disabled features (or used to have, I haven't used TextPad for a intensive work for a few years).

I have started using GVim on windows (www.vim.org) only after my skills with Regular expressions grew, and I discovered limits of TextPad.

So I do recommand TextPad as the first choice.

I also recommand EditPad pro
Because the site http://www.regular-expressions.info recommands it, and their Tutorial is THE best tutorial about RE I have ever seen. And I am quite keen on REs as you might have noticed ;-)

I am always on the hunt for even better text editor and over the years I have tried many, many editors.

If you like UltraEdit, use it. It is one of the best editors out there and it does support regular expressions (that is a very, very powerfull features for "search and replace" function)

But first of all go to
http://www.regular-expressions.info/tutorial.html
and get *inspired*.

You can do incredible things with text files with a few clever commands in a powerfull text editor. The most important thing is to get the tool you are comfortable with and start playing.
kacir is offline   Reply With Quote
Old 05-13-2007, 10:33 AM   #14
RWood
Technogeezer
RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.
 
RWood's Avatar
 
Posts: 7,233
Karma: 1601464
Join Date: Nov 2006
Location: Virginia, USA
Device: Sony PRS-500
Quote:
Originally Posted by jimmyzou
Wow, Kacir, thank yo uvery much for writing that lot.
Unfortunately or Fortunately, I' m a windows user, so I will try TextPad and Editpad Pro...

I ever used Ultraedit years ago, is this one also comparablely good?
I have programmed for many years on all sizes of machines from micros (only since 1979) to large IBM mainframe clusters and almost everything in between and I have never found a better text editor than UltraEdit.
RWood is offline   Reply With Quote
Old 05-13-2007, 11:35 AM   #15
astra
The Introvert
astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.
 
astra's Avatar
 
Posts: 8,307
Karma: 1000077497
Join Date: Jan 2007
Location: United Kingdom
Device: Sony Reader PRS-650 & 505 & 500
Quote:
Originally Posted by igorsk
In the command prompt execute:

hh -decompile <path to .chm> <directory where to put html files>

Then just convert the html files using BookDesigner or html2lrf.
You can also use one of the hundreds of fancy CHM decompilers to get the HTML.
Doesn't work. What do I do wrong?
Attached Thumbnails
Click image for larger version

Name:	chm01.JPG
Views:	484
Size:	27.5 KB
ID:	3494  
astra is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kobo and chm JCSullivan Calibre 3 05-02-2010 10:30 AM
Fictionwise - not a real deal, but possibly a good deal? orwell2k Deals and Resources (No Self-Promotion or Affiliate Links) 4 02-10-2010 08:43 AM
CHM nirax Calibre 2 11-11-2009 10:44 AM
HTML to image and CHM to images and CHM to LRF caritas LRF 0 12-14-2008 07:58 AM
.chm support? ProDigit Which one should I buy? 11 11-01-2008 06:21 AM


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


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