stoneguy
unread,Jan 17, 2011, 4:27:26 PM1/17/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to chm2pdf
Am trying to convert a book. Hope this project is still active!
1st problem encountered was correct_file() being called with the name
of a directory rather than a file. Grabbed a local copy of chm2pdf and
modded to no-op that case. (I have limited exposure to Python
programming.)
Processing continued for htm, css, and png files until correct_file
was passed a file named FamilyPsych.jpg. Looks like the jpeg was
passed to sgmllib.py, which blew up trying to interpret the bitmap as
sgml. Here's the relevant traceback
Correcting /tmp/tmpxOKBKd/x/FamilyPsych.jpg
Traceback (most recent call last):
File "/home/russ/bin/chm2pdf", line 1110, in <module>
main(sys.argv)
File "/home/russ/bin/chm2pdf", line 1104, in main
convert_to_pdf(cfile, filename, outputfilename, options)
File "/home/russ/bin/chm2pdf", line 389, in convert_to_pdf
correct_file(re.sub('\\\\ ', ' ', page_filename),
htmlout_filename, html_list, objective_urls, options)
File "/home/russ/bin/chm2pdf", line 142, in correct_file
image_catcher.feed(page)
File "/usr/lib/python2.6/sgmllib.py", line 104, in feed
self.goahead(0)
File "/usr/lib/python2.6/sgmllib.py", line 174, in goahead
k = self.parse_declaration(i)
File "/usr/lib/python2.6/markupbase.py", line 98, in
parse_declaration
decltype, j = self._scan_name(j, i)
File "/usr/lib/python2.6/markupbase.py", line 388, in _scan_name
% rawdata[declstartpos:declstartpos+20])
File "/usr/lib/python2.6/sgmllib.py", line 111, in error
raise SGMLParseError(message)
sgmllib.SGMLParseError: expected name token at '<!\xe1\xef\nx0\xeb\x1e
\x1b\xd2\xe3\xd3\xee\xd6\xe5"2\xab\x12'
Guy