async def _process_large_pdf(self, pdf_path: str) -> Tuple[str, Optional[str]]:
        """Process a large PDF by splitting it into batches under 50MB and processing each batch.

        Args:
            pdf_path: Path to the PDF file

        Returns:
            Tuple of (markdown_content, title)
        """
        import PyPDF2

        title = None
        combined_md = ""
        temp_dir = tempfile.mkdtemp()

        try:
            # Open the PDF and get page count
            with open(pdf_path, "rb") as file:
                reader = PyPDF2.PdfReader(file)
                title = self._extract_pdf_title(reader)

                # Calculate batch size
                num_pages, pages_per_batch = self._calculate_batch_size(pdf_path, reader)

                # Process in batches
                batch_num = 1
                for start_idx in range(0, num_pages, pages_per_batch):
                    end_idx = min(start_idx + pages_per_batch, num_pages)
                    batch_md = await self._process_page_batch(
                        reader, start_idx, end_idx, temp_dir, batch_num
                    )
                    combined_md += batch_md
                    batch_num += 1

            return combined_md.strip(), title

        finally:
            self._cleanup_temp_files(temp_dir)
Process a large PDF by splitting it into batches under 50MB and processing each batch.

        Args:
            pdf_path: Path to the PDF file

        Returns:
            Tuple of (markdown_content, title)
        
backend/airweave/platform/file_handling/conversion/converters/pdf_converter.py