MCPcopy Create free account
hub / github.com/OpenDCAI/Paper2Any / validate_input

Function validate_input

script/run_paper2poster_cli.py:128–140  ·  view source on GitHub ↗

Validate input PDF file and return absolute path

(input_path: str)

Source from the content-addressed store, hash-verified

126
127
128def 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
143def validate_poster_dimensions(width: float, height: float) -> tuple[float, float]:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected