Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.