4

I want to convert a chm file to a pdf file. Calibre's command ebook-convert ebook-convert 1.chm 1.pdf only converts the first 7 pages of the chm file into a pdf file, while the chm file has much more pages. How can I convert the whole chm file into a pdf file? Thanks.

Tim
  • 25,177

2 Answers2

9

You probably want to use chm2pdf from the universe repository.

To install chm2pdf in Ubuntu 14.04-18.04 open the terminal and type:

sudo apt-get install chm2pdf

You then run the command like this:

chm2pdf OPTIONS FILENAME.CHM FILENAME.PDF

Note that as OPTIONS, you must at least specify either

  • --book (structured output: headings, chapters, ...),
  • --webpage (unstructured, but page breaks between different documents/URLs in the CHM file), or
  • --continuous (unstructured output)

For more information, see man chm2pdf.

karel
  • 114,770
Byte Commander
  • 107,489
5

Try a different online converter. Zamzar is useful if the CHM file is under 100MB.

http://www.zamzar.com/convert/chm-to-pdf/

Another option is to use chm2pdf. To do so, use the following commands in a terminal session...

sudo apt-get install chm2pdf
chm2pdf foo.chm foo.pdf

That second command assumes that your CHM file is named 'foo.chm', so adjust that as appropriate.

Source: http://www.ubuntugeek.com/how-to-convert-chm-files-into-pdf-files-in-ubuntu.html

Aren
  • 483
  • +1 chm2pdf looks good, but no need for none Ubuntu based solutions (website) on ask Ubuntu :) – Mark Kirby Dec 04 '15 at 20:00
  • Just giving Tim more options (in case chm2pdf is not available in his repositories, in the interests of giving a complete answer. :) – Aren Dec 04 '15 at 20:03
  • Besides, if it's a small CHM, and this is the only one that needs conversion, it might not be worth the effort of installing additional software. ^.^ – Aren Dec 04 '15 at 20:05