ancwrd1 / qpdf-rs

Rust bindings for QPDF C++ library
17 stars 7 forks source link

Encrypt with password #4

Closed dvishal485 closed 1 year ago

dvishal485 commented 1 year ago

Can we not use qpdf-rs to encrypt pdf file? I couldn't find any similiar method to encrypt a non-encrypted pdf file in the documentation. Here is the relevant documentation from qpdf

ancwrd1 commented 1 year ago

Hi, it's not in the current implementation, I haven't figured out yet the ergonomic way of adding it in the Rust code. It's quite complicated with tons of parameters: https://qpdf.readthedocs.io/en/stable/encryption.html#pdf-encryption

But in principle it's possible to implement.

dvishal485 commented 1 year ago

Okay! Thanks for the quick response and more importantly for this project. Great work.

ancwrd1 commented 1 year ago

I have added some initial support for encryption.

dvishal485 commented 1 year ago

Thanks a lot for the prompt response!