Skip to content

Cannot extractText from generated PDF #290

@mattjmorrison-imt

Description

@mattjmorrison-imt

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions