Validate input file exists and has correct extension
(file_path: str)
| 145 | |
| 146 | |
| 147 | def validate_input_file(file_path: str) -> Path: |
| 148 | """Validate input file exists and has correct extension""" |
| 149 | path = Path(file_path) |
| 150 | |
| 151 | if not path.exists(): |
| 152 | raise FileNotFoundError(f"Input file not found: {file_path}") |
| 153 | |
| 154 | if path.suffix.lower() != ".pdf": |
| 155 | raise ValueError(f"Invalid file type. Expected .pdf, got {path.suffix}") |
| 156 | |
| 157 | return path.resolve() |
| 158 | |
| 159 | |
| 160 | def create_output_dir(args) -> Path: |