Return page content as a Python dict of images and text characters.
(self, cb=None, sort=False)
| 16555 | return val |
| 16556 | |
| 16557 | def extractRAWDICT(self, cb=None, sort=False) -> dict: |
| 16558 | """Return page content as a Python dict of images and text characters.""" |
| 16559 | val = self._textpage_dict(raw=True) |
| 16560 | if cb is not None: |
| 16561 | val["width"] = cb.width |
| 16562 | val["height"] = cb.height |
| 16563 | if sort: |
| 16564 | blocks = val["blocks"] |
| 16565 | blocks.sort(key=lambda b: (b["bbox"][3], b["bbox"][0])) |
| 16566 | val["blocks"] = blocks |
| 16567 | return val |
| 16568 | |
| 16569 | def extractRAWJSON(self, cb=None, sort=False) -> str: |
| 16570 | """Return 'extractRAWDICT' converted to JSON format.""" |
no test coverage detected