encrypt_pdf

Function encrypt_pdf 

Source
pub fn encrypt_pdf(
    pdf_data: Vec<u8>,
    password_options: &PasswordOptions,
) -> Result<Vec<u8>>
Expand description

Apply password protection to a PDF document.

Important: This function attempts to use qpdf first for proper encryption. If qpdf is not available, it falls back to an unencrypted PDF with a warning.

For guaranteed password protection, use encrypt_pdf_with_qpdf directly and handle the error if qpdf is not available.