For some reason when I use WeasyPrint to generate a pdf document I am unable to get any text from the document using PyPDF2.
"""
PyPDF2==1.25.1
WeasyPrint==0.23
"""
from PyPDF2 import PdfFileReader
from weasyprint import HTML
HTML(string="""
<html>
<body>
<div>Hello World</div>
</body>
</html>
""").write_pdf('/tmp/out.pdf')
reader = PdfFileReader('/tmp/out.pdf')
print reader.getPage(0).extractText()
For some reason when I use WeasyPrint to generate a pdf document I am unable to get any text from the document using PyPDF2.