async def _process_individual_pages(
        self, reader, start_idx: int, end_idx: int, temp_dir: str
    ) -> str:
        """Process individual pages when batch processing fails."""
        from PyPDF2 import PdfWriter

        pages_md = ""
        num_pages = len(reader.pages)

        for i in range(start_idx, end_idx):
            single_writer = PdfWriter()
            single_writer.add_page(reader.pages[i])
            temp_page_path = os.path.join(temp_dir, f"page_{i + 1}.pdf")
            with open(temp_page_path, "wb") as page_file:
                single_writer.write(page_file)
            try:
                page_md, _ = await self._process_single_pdf(temp_page_path)
                pages_md += page_md + "\n\n"
                logger.info(f"Processed page {i + 1}/{num_pages}")
            except Exception as e:
                logger.error(f"Error processing page {i + 1}: {str(e)}")

        return pages_md
Process individual pages when batch processing fails.
backend/airweave/platform/file_handling/conversion/converters/pdf_converter.py