|
HowToUse
Usage of chm2pdf
Featured Usage: /usr/bin/chm2pdf (--book / --webpage) [options] input_filename [output_filename] Either '--book' or '--webpage' MUST be given! Only one of the two options can be present, not both! chm2pdf supports most command line htmldoc options. For a full summary usage, type chm2pdf --help at the command line. PLEASE DO NOT POLLUTE THIS WIKI PAGE WITH COMMENTS If you have trouble using chm2pdf, use the Google group instead. |
► Sign in to add a comment
Do not forget to use the --enable-examples on chmLib, otherwise this script will throw a bunch of exceptions, and will fail.
If you have a mac, and you use darwin ports (port on the cmdline), be aware that the chmlib will NOT be built with this option. You can, however, separately download chmlib and build it yourself with this option, install it, and then re-run the script.
make sure you have python-chm bindings installed !!!
or you get an error like
ImportError?: No module named chm.chmOn my ubuntu Feisty this is what I obtain:
Traceback (most recent call last):
IOError: 2? No such file or directory: '../tempout//final/toc.html'think the error is in the last line, that double slash "//".
I try to fix it but still got the same... it seems it don't create the tempout directory :-(
On Ubuntu box if you are getting following error
OError: 2? No such file or directory: '../tempout//final/toc.html' and chm2pdf complaains about libchm.so.0 run the command below:
sudo ln -s /usr/local/lib/libchm.so.0 /usr/lib/libchm.so.0
START-QUOTE
On my ubuntu Feisty this is what I obtain:
Traceback (most recent call last):
IOError: 2? No such file or directory: '../tempout//final/toc.html'
think the error is in the last line, that double slash "//".
I try to fix it but still got the same... it seems it don't create the tempout directory :-(
END-QUOTE
Me too. I obtain the same error on Suse 10.1
I have done sudo ln -s /usr/local/lib/libchm.so.0 /usr/lib/libchm.so.0 but the situation is unchanged. Anyway, chm2pdf doesn't complains about libchm.so.0 .
Quilos did you solved the problem '../tempout//final/toc.html' ?
On Ubuntu, open the chm2pdf.py file using your favourite editor and search for or scroll down to the
Section and change the code to
print 'Concatenating '+str(c)+' individual PDF files...' os.system("pdftk *.pdf cat output "+outputfilename)Re run the setup and It Works like a charm ;)
To bluboy. On Suse, this doesn't solve my problem.
I ve got this in the last line:
IOError: 2? No such file or directory: '../tempout//./HTML/pic1.jpg'
Please make chm2pdf inform you when the commands enum_chmLib and htmldoc are not available.
I've got "IOError: No such file or directory" because enum_chmLib wasn't in the system. Before installing libchm-dev it finished printing "Done" at the end, but no pdf was there, because htmldoc wasn't found. After installing htmldoc all was fine.
On Opensuse 10.3, I installed chm2pdf and chmlib (from source with --enable-example), pychm (I extract the tarball in /) and htmldoc (from suse repository), but it appers:
# chm2pdf Traceback (most recent call last):
ImportError?: No module named chm.chmThanks
On ubuntu7, I got HTMLDOC window, when I click the button 'Generate', it prompts "No HTML files to format, cannot generate document". Can anyone tell me what is wrong?
Thanks
I'm on Ubuntu Gutsy 7.10. Followed the nice walkthrough for Ubuntu and managed to convert a 1000+ pages CHM correctly. However subsequent conversions all failed with "no pages generated", but next line says "Written file blah.pdf". Tried to remove /tmp/chm2pdf before conversion - no luck. Also the script cannot parse filenames with blanks even when specified like so: "filename with blank.chm"
On Ubuntu 8.04, I also had an error "OError: 2? No such file or directory:..."; the workaround for this problem is to change the .CHM file name to a simpler form (i.e. no dots before ".chm" and no spaces within the file name), and it worked. one thing that was little bit odd was --book did not work, but --webpage worked.
Thank you for making chm2pdf available
yes joseph your solution is right , it is working chm2pdf --webpage filename.chm there should be no spaces in file name . Thanks a lot Usman ali
Haven't seen a script containing this many obvious bugs. Code itself is well... not clean, to say the least.
This thing needs a complete rewrite, I suppose.
This script works just fine. You just need to run the script without any spaces in the file name.
On Debian Lenny
[root] [/home/nercof/Desktop]$ chm2pdf --book OReilly.Twisted.Network.Programming.Essentials.Python.Oct.2005.chm OReilly.Twisted.Network.Programming.Essentials.Python.Oct.2005.pdf rm: no se puede borrar «/tmp/chm2pdf/orig/OReilly.Twisted.Network.Programming.Essentials.Python.Oct.2005/*»: No existe el fichero o el directorio rm: no se puede borrar «/tmp/chm2pdf/work/OReilly.Twisted.Network.Programming.Essentials.Python.Oct.2005/*»: No existe el fichero o el directorio sh: /tmp/chm2pdf/work/OReilly.Twisted.Network.Programming.Essentials.Python.Oct.2005/urlslist.txt: No existe el fichero o el directorio Traceback (most recent call last): File "/usr/bin/chm2pdf", line 1111, in <module> main(sys.argv) File "/usr/bin/chm2pdf", line 1107, in main convert_to_pdf(cfile, filename, outputfilename, options) File "/usr/bin/chm2pdf", line 326, in convert_to_pdf objective_urls=get_objective_urls_list(filename) File "/usr/bin/chm2pdf", line 114, in get_objective_urls_list flist=open(CHM2PDF_WORK_DIR+'/urlslist.txt','rU') IOError: [Errno 2] No such file or directory: '/tmp/chm2pdf/work/OReilly.Twisted.Network.Programming.Essentials.Python.Oct.2005/urlslist.txt' [root] [/home/nercof/Desktop]$which may be the problem?
on Ubuntu 9.04
manish@manish-laptop:~$ /usr/bin/chm2pdf --book '/home/manish/Desktop/a.chm' a.pdf Traceback (most recent call last):
IOError: 21? Is a directory: '/tmp/tmp8V56Zx/a/' manish@manish-laptop:~$ /usr/bin/chm2pdf --webpage '/home/manish/Desktop/a.chm' a.pdf Traceback (most recent call last): IOError: 21? Is a directory: '/tmp/tmpU5qsF8/a/'what is the problem?
as per this given link
am facing bellow error, 1>chm2pdf --book my-file.chmroot@AmSi?:/home/amaresh/Desktop# chm2pdf --book Glass\,Ables\ -\ Linux\ for\ Programmers\ and\ Users\ \(Prentice\,\ 2006\).chm CHM2PDF_WORK_DIR = /tmp/chm2pdf/work/Glass,Ables - Linux for Programmers and Users (Prentice, 2006) CHM2PDF_ORIG_DIR = /tmp/chm2pdf/orig/Glass,Ables - Linux for Programmers and Users (Prentice, 2006) Removing any previous temporary files sh: Syntax error: "(" unexpected sh: Syntax error: "(" unexpected sh: Syntax error: "(" unexpected sh: Syntax error: "(" unexpected Traceback (most recent call last):
IOError: 2? No such file or directory: '/tmp/chm2pdf/work/Glass,Ables - Linux for Programmers and Users (Prentice, 2006)/urlslist.txt'Waiting for solution,
2>chm2pdf --book --title my-file.chm
root@AmSi?:/home/amaresh/Desktop# chm2pdf --book --title Glass\,Ables\ -\ Linux\ for\ Programmers\ and\ Users\ \(Prentice\,\ 2006\).chm CHM2PDF_WORK_DIR = /tmp/chm2pdf/work/Glass,Ables - Linux for Programmers and Users (Prentice, 2006) CHM2PDF_ORIG_DIR = /tmp/chm2pdf/orig/Glass,Ables - Linux for Programmers and Users (Prentice, 2006) Removing any previous temporary files sh: Syntax error: "(" unexpected sh: Syntax error: "(" unexpected sh: Syntax error: "(" unexpected sh: Syntax error: "(" unexpected Traceback (most recent call last): IOError: 2? No such file or directory: '/tmp/chm2pdf/work/Glass,Ables - Linux for Programmers and Users (Prentice, 2006)/urlslist.txt'
chm2pdf works fine for me for simple filenames like myfile.chm It does give problems for file that are name like Linux for programmers that use brackets like ( and ) and spaces in their filenames.chm Just rename your chm-file first
The cause of error:
failed to open Web Traceback (most recent call last):
is the name of the chm file, i.e, Book Test.chm....the correct name should be: BookTest?.chm, otherwise chm2pdf dont't work.
i'm getting the following error: bash-3.1# chm2pdf --book book.chm rm: cannot remove `/tmp/chm2pdf/orig/book/': No such file or directory rm: cannot remove `/tmp/chm2pdf/work/book/': No such file or directory sh: /tmp/chm2pdf/work/book/urlslist.txt: No such file or directory Traceback (most recent call last):
IOError: 2? No such file or directory: '/tmp/chm2pdf/work/book/urlslist.txt' don't know what's the problemJust create these directories You need both /tmp/chm2pdf/orig/book/ and /tmp/chm2pdf/work/book/ for your example
This script is lame. Gunna just do it at work in windows.
I tried the chm2pdf pilot. Produced PDF, but w/o a Table of contents. Is this as expected? Does the latest, retail version produce a TOC?