如何在Python3中将HTML转换为PDF?
Xhtml2pdf不能在Python3中工作,会出现错误:
import xhtml2pdf.pisa as pisa Traceback (most recent call last): File "", line 1, in File "/home/hound/test/python/test_env/lib/python3.4/site-packages/xhtml2pdf/init.py", line 41, in from xhtml2pdf.util import REPORTLAB22 File "/home/hound/test/python/test_env/lib/python3.4/site-packages/xhtml2pdf/util.py", line 302 raise Exception, "box not defined right way" ^ SyntaxError: invalid syntax
Xhtml2pdf不能在Python3中工作,会出现错误:
import xhtml2pdf.pisa as pisa Traceback (most recent call last): File "", line 1, in File "/home/hound/test/python/test_env/lib/python3.4/site-packages/xhtml2pdf/init.py", line 41, in from xhtml2pdf.util import REPORTLAB22 File "/home/hound/test/python/test_env/lib/python3.4/site-packages/xhtml2pdf/util.py", line 302 raise Exception, "box not defined right way" ^ SyntaxError: invalid syntax
overflow-wrap: break-word;
,还需要设置width: x;
。 - deusofnull