Welcome to the WinForms feedback portal. We’re happy you’re here! If you have feedback on how to improve the WinForms, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
I have created two WinForms a .net4.8 and .net7, with SAME code,
in .Net 4.8 everything is Ok. you can open the PDF with the password you set. BUT in .net7 it protects the PDF file successfully But when you try to open the file with the right password it prompts as INVALID/wrong password.
using var stream = new FileStream(file, FileMode.Open);
var source = new PdfLoadedDocument(stream);
var security = source.Security;
security.UserPassword = pdfPassword;
security.OwnerPassword = pdfPassword;
source.Save(stream);