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
  • 26,107

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
  • 122,292
  • 133
  • 301
  • 332
Byte Commander
  • 110,243
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