Validate input PDF file and return absolute path
(input_path: str)
| 126 | |
| 127 | |
| 128 | def validate_input(input_path: str) -> str: |
| 129 | """ |
| 130 | Validate input PDF file and return absolute path |
| 131 | """ |
| 132 | path = Path(input_path) |
| 133 | if not path.exists(): |
| 134 | raise FileNotFoundError(f"Input file not found: {input_path}") |
| 135 | |
| 136 | ext = path.suffix.lower() |
| 137 | if ext != ".pdf": |
| 138 | raise ValueError(f"Expected PDF file, got {ext}") |
| 139 | |
| 140 | return str(path.resolve()) |
| 141 | |
| 142 | |
| 143 | def validate_poster_dimensions(width: float, height: float) -> tuple[float, float]: |