[docs]defdecrypt_pdf(input_path:Path,output_path:Path,password:str)->None:"""Decrypts a PDF file."""withwarnings.catch_warnings():warnings.simplefilter("ignore",UserWarning)pdf=pikepdf.open(input_path,password=password,allow_overwriting_input=True)ifnotpdf.is_encrypted:raiseValueError(f"File {input_path} is not encrypted.")pdf.save(output_path)pdf.close()