CHM e-book cover extraction

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

Robottinosino

Posted 2012-03-15T00:39:04.583

Reputation: 351

Answers

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

Sebastian Stumpf

Posted 2012-03-15T00:39:04.583

Reputation: 604

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 – 2012-03-15T01:01:32.887

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.

Marco van de Voort

Posted 2012-03-15T00:39:04.583

Reputation: 211