-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
workflow-imagesFrom a users perspective, image handling is the affected feature/workflowFrom a users perspective, image handling is the affected feature/workflow
Description
Explanation
The RunLengthDecode filter does not seem to be implemented.
It seems like a corresponding example file is very easy to create by just running ImageMagick on a PDF file of your choice: convert -density 300 -units PixelsPerInch test_document.pdf -alpha off out.pdf (example: out.pdf)
Code Example
reader = PdfReader('tmp/out.pdf')
page = reader.pages[0]
for image in page.images:
print(image)Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/user/lib/python3.9/site-packages/pypdf/_page.py", line 2604, in __iter__
yield self[i]
File "/home/user/lib/python3.9/site-packages/pypdf/_page.py", line 2600, in __getitem__
return self.get_function(lst[index])
File "/home/user/lib/python3.9/site-packages/pypdf/_page.py", line 522, in _get_image
imgd = _xobj_to_image(cast(DictionaryObject, xobjs[id]))
File "/home/user/lib/python3.9/site-packages/pypdf/filters.py", line 854, in _xobj_to_image
data = x_object_obj.get_data() # type: ignore
File "/home/user/lib/python3.9/site-packages/pypdf/generic/_data_structures.py", line 956, in get_data
decoded._data = decode_stream_data(self)
File "/home/user/lib/python3.9/site-packages/pypdf/filters.py", line 634, in decode_stream_data
raise NotImplementedError(f"unsupported filter {filter_type}")
NotImplementedError: unsupported filter /RunLengthDecodeReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
workflow-imagesFrom a users perspective, image handling is the affected feature/workflowFrom a users perspective, image handling is the affected feature/workflow