IOError: [Errno 21] on converting from chm to pdf

Asked by manishmahabir

i get the following error

manish@manish-laptop:~$ /usr/bin/chm2pdf --book '/home/manish/Desktop/a.chm' a.pdf
Traceback (most recent call last):
  File "/usr/bin/chm2pdf", line 1098, in <module>
    main(sys.argv)
  File "/usr/bin/chm2pdf", line 1092, in main
    convert_to_pdf(cfile, filename, outputfilename, options)
  File "/usr/bin/chm2pdf", line 386, in convert_to_pdf
    correct_file(page_filename, htmlout_filename, html_list, objective_urls, options)
  File "/usr/bin/chm2pdf", line 131, in correct_file
    pf=open(input_file,'rU')
IOError: [Errno 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):
  File "/usr/bin/chm2pdf", line 1098, in <module>
    main(sys.argv)
  File "/usr/bin/chm2pdf", line 1092, in main
    convert_to_pdf(cfile, filename, outputfilename, options)
  File "/usr/bin/chm2pdf", line 386, in convert_to_pdf
    correct_file(page_filename, htmlout_filename, html_list, objective_urls, options)
  File "/usr/bin/chm2pdf", line 131, in correct_file
    pf=open(input_file,'rU')
IOError: [Errno 21] Is a directory: '/tmp/tmpU5qsF8/a/'

/**********************************/
/***** Another one for me :/ ********/
/**********************************/
Traceback (most recent call last):
  File "/usr/bin/chm2pdf", line 1108, in <module>
    main(sys.argv)
  File "/usr/bin/chm2pdf", line 1102, in main
    convert_to_pdf(cfile, filename, outputfilename, options)
  File "/usr/bin/chm2pdf", line 387, in convert_to_pdf
    correct_file(re.sub('\\\\ ', ' ', page_filename), htmlout_filename, html_list, objective_urls, options)
  File "/usr/bin/chm2pdf", line 131, in correct_file
    pf=open(input_file,'rU')
IOError: [Errno 21] Is a directory: '/tmp/tmpy9eu9h/test_larger/'

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu chm2pdf Edit question
Assignee:
No assignee Edit question
Solved by:
tea_b
Solved:
Last query:
Last reply:
Revision history for this message
sajanagr (sajan-agr) said :
#1
Revision history for this message
manishmahabir (manishmahabir) said :
#2

@sajanagar

thanks for your help
as you can see i have got the commands from the pages you have mentioned.
but on using the command i get the error.

IOError: [Errno 21] Is a directory

on googling i have found that this error is found in other contexts also, but i have no idea why this error occurs.

Revision history for this message
sajanagr (sajan-agr) said :
#3

hmm.. have you installed all the dependencies

http://code.google.com/p/chm2pdf/wiki/HowToInstall

Ubuntu/Kubuntu/Debian: Anyway, you should need:

    * libchm
    * libchm-bin
    * libchm-dev
    * python-chm
    * html-doc
    * htmldoc-common

I think this might be the problem... can't think of otherwise now.

Keep updating

Revision history for this message
manishmahabir (manishmahabir) said :
#4

only libchm-dev was not installed. after installing it, i again ran the command. same error.

manish@manish-laptop:~$ /usr/bin/chm2pdf --webpage '/home/manish/Desktop/a.chm' a.pdf
Traceback (most recent call last):
  File "/usr/bin/chm2pdf", line 1098, in <module>
    main(sys.argv)
  File "/usr/bin/chm2pdf", line 1092, in main
    convert_to_pdf(cfile, filename, outputfilename, options)
  File "/usr/bin/chm2pdf", line 386, in convert_to_pdf
    correct_file(page_filename, htmlout_filename, html_list, objective_urls, options)
  File "/usr/bin/chm2pdf", line 131, in correct_file
    pf=open(input_file,'rU')
IOError: [Errno 21] Is a directory: '/tmp/tmpELY87D/a/'
manish@manish-laptop:~$

Revision history for this message
Michael Lustfield (michaellustfield) said :
#5

This looks like it may be a bug... Just to check, please execute this comamnd "sudo rm -Rf /tmp/tmp*" reboot, and try again.

Revision history for this message
Best tea_b (lynn3521) said :
#6

If you want to convert .chm file to .pdf file you need to install a CHM to PDF Converter application.
ABC Amber CHM Converter is a powerful CHM to PDF converter which allows you to convert CHM to PDF, HTML or other document formats, etc.

this article will tell you step-by-step to convert CHM to PDF with ABC Amber CHM Converter:http://www.bestshareware.net/howto/how-to-convert-chm-to-pdf.htm

ABC Amber CHM Converter: http://www.bestshareware.net/software/abc-amber-chm-converter.htm

Revision history for this message
manishmahabir (manishmahabir) said :
#7

there is no need for that...
i decompiled the chm file and used htmldoc manually...it did the trick.
i had tried almost all the available options on windows...but this worked way better than anyone of them!
Anyway...thanks for replying.