#!/usr/bin/env python3

import fitz

def verify_pdf(file_path):
    """Verify the PDF has the correct number of pages and is valid"""
    try:
        doc = fitz.open(file_path)
        page_count = len(doc)
        print(f"✅ PDF is valid with {page_count} pages")
        doc.close()
        return page_count
    except Exception as e:
        print(f"❌ Error reading PDF: {e}")
        return None

if __name__ == "__main__":
    original_count = verify_pdf("/root/.openclaw/workspace/work/temp/deck-2.pdf")
    clean_count = verify_pdf("/root/.openclaw/workspace/work/temp/deck-2-clean.pdf")
    
    if original_count == clean_count:
        print(f"✅ Success! Both PDFs have {clean_count} pages. Logo removal completed successfully.")
    else:
        print(f"❌ Warning! Page count mismatch: Original={original_count}, Clean={clean_count}")