J-F-Liu / lopdf

A Rust library for PDF document manipulation.
MIT License
1.67k stars 176 forks source link

URI in annotation does not get decrypted #336

Open StephanvanSchaik opened 2 months ago

StephanvanSchaik commented 2 months ago

I modified the print_annotations example as follows to handle PDF files that have been encrypted with an empty password:

    Ok(mut doc) => {
        if doc.is_encrypted() {
            doc.decrypt("");
        }

        let _ = handle_pdf_page(doc);
    }

However, despite the decryption working for other parts of the PDF. It does not seem to decrypt the URI in links. They still end up seemingly garbled, whereas they are supposed to be a valid UTF-8 (?) string (and I confirmed that the links work in mupdf), which is why I am assuming that they didn't get decrypted.