How to convert CHM to PDF in Linux
1. Install dependencies by running the following command in the terminal:
2. Next, download chm2pdf by clicking here or using wget
3. Now extract the downloaded file.
4. Browse to the folder you extracted and run:
sudo python setup.py install
Now on the command line, type:
chm2pdf examples
Unstructured HTML files inside the CHM file, use of –webpage option – produces my-file.pdf:
Structured HTML files:
Structured HTML files, produce a table of contents page automatically (–title option):
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:
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:
Like above, but name the PDF “your-file.pdf”:
A very interesting option (and one that is not htmldoc-specific, but is pure chm2pdf-specific) is the –extract-only option:
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
December 10th, 2011 at 7:47 pm
english landmarks…
[...]Linux Shtuff » Blog Archive » Convert CHM to PDF[...]…
January 4th, 2012 at 3:32 pm
Only wanna tell that this is very helpful , Thanks for taking your time to write this.
January 8th, 2012 at 10:38 am
I am impressed with this web site, real I am a fan.
January 9th, 2012 at 3:58 am
I wanted to thank you one more time for your amazing web site you have created here. It’s full of ideas for those who are actually interested in this specific subject, especially this very post. You really are all absolutely sweet and thoughtful of others and reading your website posts is a good delight if you ask me. And what a generous reward! Mary and I are going to have excitement making use of your guidelines in what we need to do in the future. Our checklist is a mile long which means that your tips will be put to fine use.
January 10th, 2012 at 4:21 am
I like this post, enjoyed this one regards for putting up.