0

I would like to extract a "book cover image" from a series of CHM files, which command line tool can do that, please?

I have looked at the source of the QuickLook plug-in "quickchm1.1_source" and at the calibre command line conversion options (ebook-convert) but couldn't find anything akin to simple:

name_of_tool file_to_convert output_image

as in:

mytool routermanual.chm routermanualcoverimage.png

2 Answers 2

0

CHM is basically just "compiled HTML". I'm not sure if you could create an image from the first page, but have a look at Calibre which will allow you to convert the CHM to a PDF.

From the PDF you should be able to create an image from the first page via imagemagick:

 $ convert "something.pdf[0]" cover.jpg
1
  • ImageMagick is exactly what I do for PDFs already, I am looking for a one-step solution for CHMs too, though. Thanks for the "workaround" answer! Mar 15, 2012 at 1:01
0

The chmls command in the Free Pascal distribution has an extract command.

CHMs have no explicit cover though, but a default html page (which might embed the image). This means you might have some parsing to do to extract the name of that image from the html.

Currently the chmls command doesn't have a command to print the name of that html page. I'm preparing a new revision, and future versions will.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .