Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
up vote 0 down vote accepted

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
share|improve this answer
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! – Robottinosino Mar 15 '12 at 1:01

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.

share|improve this answer

You must log in to answer this question.

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