| 152 | |
| 153 | class PPTXReader(Reader): |
| 154 | def parse(self, file_path: Path) -> str: |
| 155 | logger.info(f"Reading PowerPoint file from {file_path}.") |
| 156 | try: |
| 157 | pres = Presentation(str(file_path)) |
| 158 | text = [] |
| 159 | for slide_idx, slide in enumerate(pres.slides): |
| 160 | text.append(f"Slide {slide_idx + 1}:\n") |
| 161 | for shape in slide.shapes: |
| 162 | if hasattr(shape, "text"): |
| 163 | text.append(shape.text) |
| 164 | return "\n".join(text) |
| 165 | except Exception as e: |
| 166 | logger.info(f"Error reading PowerPoint file: {e}") |
| 167 | return "Error reading PowerPoint file." |
| 168 | |
| 169 | class ExcelReader(Reader): |
| 170 | def parse(self, file_path: Path) -> str: |