feat: enhance menu management with three-level hierarchy support, additional metadata fields, and utility scripts for data extraction
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import sys
|
||||
from pypdf import PdfReader
|
||||
|
||||
pdf_path = sys.argv[1]
|
||||
output_path = sys.argv[2]
|
||||
|
||||
reader = PdfReader(pdf_path)
|
||||
text = ""
|
||||
for i, page in enumerate(reader.pages):
|
||||
text += f"\n--- Page {i + 1} ---\n"
|
||||
text += page.extract_text()
|
||||
|
||||
with open(output_path, "w", encoding="utf-8") as f:
|
||||
f.write(text)
|
||||
print(f"Extracted {len(reader.pages)} pages to {output_path}")
|
||||
Reference in New Issue
Block a user