Sponsored Link
Install chm2pdf in ubuntu
sudo aptitude install chm2pdf
Using chm2pdf
chm2pdf syntax
/usr/bin/chm2pdf [options] input_filename [output_filename]
chm2pdf examples
Unstructured HTML files inside the CHM file, use of --webpage
option -- produces my-file.pdf:
chm2pdf --webpage
my-file.chm
Structured HTML files:
chm2pdf --book
my-file.chm
Structured HTML files, produce a table of contents page automatically (--title
option):
chm2pdf --book --title
my-file.chm
Structured HTML files, produce a table of contents page automatically (--title
option), add a "titlepage" as found in the toc.html file inside the CHM:
chm2pdf --book --title --titlefile
toc.html my-file.chm
If the file "toc.html" is not found, a warning will be issued and the option will be ignored -- just browse the (very verbose) output of chm2pdf to see that warning if you suspect you mispelled the titlefile name.
Like above, now with an explicitly set page size and maximum compression level for the resulting PDF:
chm2pdf --book --title --titlefile
toc.html --size
177.8×233.3mm --compression
9 my-file.chm
Like above, but name the PDF "your-file.pdf":
chm2pdf --book --title --titlefile
toc.html --size
177.8×233.3mm --compression
9 my-file.chm your-file.pdf
A very interesting option (and one that is not htmldoc-specific, but is pure chm2pdf-specific) is the --extract-only
option:
chm2pdf --extract-only
my-file.chm
will extract the contents of my-file.chm (all the HTML and other, "special", files inside the CHM) into the directory CHM2PDF_TEMP_ORIG_DIR/my-file. Thus, if CHM2PDF_TEMP_ORIG_DIR has its default value "/tmp/chm2pdf/orig", chm2pdf will extract the file into /tmp/chm2pdf/orig/my-file and stop. You can then examine the extracted files at your pace. They will be overwritten next time you call chm2pdf with the same file(name).
If you want to know more available options use the following command from your terminal
chm2pdf --help
YES!
A million thanks to whoever packaged this for Ubuntu/Debian!
I have Ubuntu 7.10, and the ch2pdf package doesn’t exists, The solution? Easy:
First install this packages:
sudo aptitude install libchm-bin libchm-dev htmldoc python-chm
Second
Download de chm2pdf script on this site: http://code.google.com/p/chm2pdf/
Thanks for the tip 😀
great help man.
thnx.
with your permission, can I post the link of this webpage in my blog?
yes you can post the source link
thnx.
the only way I could get chm2pdf to work was with
--
continuous option, it wouldn’t work with--
book or--
title… could be because of my RFTM syndrome.. either way I hope this helps some people.hi, iam very new to kubuntu. how can i open .chm files without converting to pdf format
@ramakanth
Try to install kchmviewer using the following command
sudo apt-get install kchmviewer
That’s it after completing the installation you should be able to view .chm files
hi, iam very new to ubuntu. im using hardy heron. how can i open .chm files without converting to pdf format? thanks..
@Arthur
Here is the article http://www.ubuntugeek.com/how-to-view-chm-microsoft-compiled-html-help-files-in-ubuntu.html
thanks..
Hello!
Question about chm2pdf.
Don’t know if this the right place to ask.
If not please redirect me!
Also don’t know if I have missed something in the “–help” menu of chm2pdf.
If so enlighten me please!
Q: In Ubuntu 9.10:
Using xCHM v.1.17 to read .chm-file works fine, Pictures showing up.
But after having converted to .pdf-file vith chm2pdf 0.9.1 …..
No more pictures.
A feature or a bug?
Size of .chm-file = 170KB.
Size of .pdf-file = 340KB.
tia
/Gustav
cool!
thanx man
chm2pdf –book –title –titlefile toc.html –size 177.8×233.3mm –compression 9 my-file.chm your-file.pdf
a million thanx man…..
I get the following error:
Traceback (most recent call last):
File “/usr/bin/chm2pdf”, line 1108, in
main(sys.argv)
File “/usr/bin/chm2pdf”, line 1102, in main
convert_to_pdf(cfile, filename, outputfilename, options)
File “/usr/bin/chm2pdf”, line 317, in convert_to_pdf
html_list=get_html_list(cfile)
File “/usr/bin/chm2pdf”, line 106, in get_html_list
lister.feed(topicstree)
File “/usr/lib/python2.7/sgmllib.py”, line 103, in feed
self.rawdata = self.rawdata + data
TypeError: cannot concatenate ‘str’ and ‘NoneType’ objects
Please help!