MCPcopy Create free account
hub / github.com/VectifyAI/PageIndex / get_text_of_pdf_pages_with_labels

Function get_text_of_pdf_pages_with_labels

pageindex/utils.py:420–424  ·  view source on GitHub ↗
(pdf_pages, start_page, end_page)

Source from the content-addressed store, hash-verified

418 return text
419
420def get_text_of_pdf_pages_with_labels(pdf_pages, start_page, end_page):
421 text = ""
422 for page_num in range(start_page-1, end_page):
423 text += f"<physical_index_{page_num+1}>\n{pdf_pages[page_num][0]}\n<physical_index_{page_num+1}>\n"
424 return text
425
426def get_number_of_pages(pdf_path):
427 pdf_reader = PyPDF2.PdfReader(pdf_path)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected