There is no XHTMLParser
in html5parser, and the source code of pisa indicates that the xhtml=True
flag is permanently broken:
if xhtml:
#TODO: XHTMLParser doesn't see to exist...
parser = html5lib.XHTMLParser(tree=treebuilders.getTreeBuilder("dom"))
Fortunately, XHTML is often valid HTML as well, so you don't need any conversion. Therefore, simply find out why the pdf generated is all wrong - XHTML is not the problem here.