bca_survival.tools.pdf_report_extractor module
PDF Encryption Script Finds all PDF files in a directory tree, copies them to a destination folder with names based on their parent directory, and encrypts them using pdftk.
- bca_survival.tools.pdf_report_extractor.encrypt_pdf(input_path, output_path, password)[source]
Encrypt a PDF file using pdftk.
- Parameters:
input_path (
Path) – Path to the input PDF fileoutput_path (
Path) – Path to save the encrypted PDFpassword (
str) – Password to encrypt the PDF with
- Returns:
True if successful, False otherwise
- Return type:
bool
- bca_survival.tools.pdf_report_extractor.process_pdfs(root_path, destination_path, password)[source]
Find all PDFs in the root path, copy and encrypt them to the destination.
- Parameters:
root_path (
Union[Path,str]) – Root directory to search for PDFsdestination_path (
Union[Path,str]) – Directory to save encrypted PDFspassword (
str) – Password for encryption
- Return type:
None