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 file

  • output_path (Path) – Path to save the encrypted PDF

  • password (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 PDFs

  • destination_path (Union[Path, str]) – Directory to save encrypted PDFs

  • password (str) – Password for encryption

Return type:

None

bca_survival.tools.pdf_report_extractor.main()[source]

Main function to handle command line arguments and run the script.

Return type:

None