pub fn encrypt_pdf_with_qpdf(
pdf_data: Vec<u8>,
password_options: &PasswordOptions,
temp_dir: Option<&str>,
) -> Result<Vec<u8>>
Expand description
Apply password protection using external qpdf tool (if available). This is a more robust solution for production use.
§Prerequisites
- qpdf must be installed on the system
- Sufficient disk space for temporary files
§Arguments
pdf_data
: The PDF data to encryptpassword_options
: Password and encryption settingstemp_dir
: Optional temporary directory (defaults to /tmp)
§Returns
Ok(Vec<u8>)
: Encrypted PDF dataErr(Html2PdfError)
: If qpdf is not available or encryption fails