Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

TypeError: object of type 'zip' has no len() #264

@clach04

Description

@clach04

Error extracting images using:

py -3 pdf2txt.py -o test.html -O test_images FightingGamePrimer.pdf

get error:

Traceback (most recent call last):
  File "pdf2txt.py", line 115, in <module>
    if __name__ == '__main__': sys.exit(main(sys.argv))
  File "pdf2txt.py", line 110, in main
    interpreter.process_page(page)
  File "C:\code\py\pdf\pdfminer\pdfminer\pdfinterp.py", line 842, in process_page
    self.device.end_page(page)
  File "C:\code\py\pdf\pdfminer\pdfminer\converter.py", line 50, in end_page
    self.receive_layout(self.cur_item)
  File "C:\code\py\pdf\pdfminer\pdfminer\converter.py", line 387, in receive_layout
    render(ltpage)
  File "C:\code\py\pdf\pdfminer\pdfminer\converter.py", line 343, in render
    render(child)
  File "C:\code\py\pdf\pdfminer\pdfminer\converter.py", line 352, in render
    render(child)
  File "C:\code\py\pdf\pdfminer\pdfminer\converter.py", line 355, in render
    self.place_image(item, 1, item.x0, item.y1, item.width, item.height)
  File "C:\code\py\pdf\pdfminer\pdfminer\converter.py", line 277, in place_image
    name = self.imagewriter.export_image(item)
  File "C:\code\py\pdf\pdfminer\pdfminer\image.py", line 74, in export_image
    if len(filters) == 1 and filters[0][0] in LITERALS_DCT_DECODE:
TypeError: object of type 'zip' has no len()

Attached sample (CC licensed) demo file
FightingGamePrimer.pdf but I suspect any pdf with images will have issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions