pdfinspector / test_app_analyze.py
rianders's picture
Include example PDFs with Git LFS and add helper scripts
e6ea8c6
raw
history blame contribute delete
761 Bytes
from app import analyze
import traceback
def test_analyze():
pdf_path = "test_document.pdf"
page_num = 1
dpi = 72
order_mode = "raw"
show_spans = False
highlight_math = False
try:
print(f"Analyzing {pdf_path}...")
overlay, report, summary, preview = analyze(
pdf_path, page_num, dpi, order_mode, show_spans, highlight_math
)
print("Analysis successful!")
print(f"Summary length: {len(summary)}")
print(f"Preview length: {len(preview)}")
print(f"Report keys: {report.keys()}")
print(f"Overlay size: {overlay.size}")
except Exception as e:
print(f"CRASHED: {e}")
traceback.print_exc()
if __name__ == "__main__":
test_analyze()