Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 05-18-2023, 02:00 PM   #1
Britpunk
Junior Member
Britpunk began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2023
Device: Fire
CHM -> EPUB conversion not finding right content

I have been tasked with converting some CHM files to EPUB. I suspect the CHM may have an unusual structure as it seems to be causing Calibre some problems. The CHM file opens as expected if I use the Windows Help application, so I am certain the file itself is intact.

If I unpack the .chm file I see the following files at root:
#IDXHDR
#ITBITS
#STRINGS
#SYSTEM
#TOPICS
#URLSTR
#URLTBL
#WINDOWS
cbr.css

and the directories:
chmfile
images

Within the 'chmfile' directory is the actual core content - approximately 1,250 HTM files, a 'Downloads' directory containing some Word documents, and an 'images' directory containing some JPG images.

Calibre appears to be detecting the wrong structure, as what gets produced is an .epub file, but all of the content is just the contents of the cbr.css file from the root. I'm certain there's some way to get it to pick up the correct content from the chmfile directory, but I'm not familiar enough with the tool yet.

Any help will be tremendously appreciated.

David
Britpunk is offline   Reply With Quote
Old 05-18-2023, 09:02 PM   #2
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,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Since you have the unpacked HTMl you can just convert that directly, see https://manual.calibre-ebook.com/faq...specific-order
kovidgoyal is online now   Reply With Quote
Advert
Old 05-19-2023, 04:46 AM   #3
Britpunk
Junior Member
Britpunk began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2023
Device: Fire
Thank you, I'm very grateful for your suggestion. Unfortunately I have a couple of thousand to convert so was trying to complete this as a batch process without regular manual intervention.

Speaking generally is there a way to force the structure detection to go deeper than it is?
Britpunk is offline   Reply With Quote
Old 05-19-2023, 05:48 AM   #4
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,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No there is no way you can change what the chm input plugin reads from the chm file, short of modifying the code of chmlib.
kovidgoyal is online now   Reply With Quote
Old 05-19-2023, 06:34 AM   #5
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,010
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Try a 3rd party chm converter, there are ones that "unpack" to html on Linux. Not sure about Windows, but I'd assume they exist. Though conversion of a set of HTML files in a directory (I've saved websites with wget) works with calibre, the results sometimes need edited.

Not sure if any of the 3rd party viewers export to docx or html, but unless there is a command line interface that's tedious.

Conversion to PDF exists, but PDF is really a terminal format that's a disaster to convert to anything other than paper, screen or images!

Last edited by Quoth; 05-19-2023 at 06:36 AM.
Quoth is offline   Reply With Quote
Advert
Old 05-19-2023, 07:20 AM   #6
Britpunk
Junior Member
Britpunk began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2023
Device: Fire
Great, I appreciate the responses thank you.
Britpunk is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nightmare epub: it's full of tables (conversion from CHM?) MelBr Conversion 2 02-23-2013 11:28 AM
chm to epub conversion problems drdaman Conversion 1 12-09-2012 08:59 PM
chm to epub conversion pb between 0.8.23 and 0.8.24 (OSX) fab672000 Conversion 2 11-05-2011 05:26 PM
CHM to Epub conversion error pweasel Conversion 0 10-04-2011 06:02 PM
Epub conversion problems from CHM Chrisness Calibre 0 09-27-2011 07:30 PM


All times are GMT -4. The time now is 03:47 AM.


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