QPdfSharp icon indicating copy to clipboard operation
QPdfSharp copied to clipboard

user password IsEncrypted exception

Open tfouto opened this issue 1 year ago • 0 comments

Is it possible to check if a pdffile has a user password without giving an Exception?

the only way I can do that with a user password is this way:

try { using var qpdf = new QPdf(fileBytes, "in-memory pdf"); return qpdf.IsEncrypted; } catch(Exception e) { if (e.Message.Contains("invalid password")) { return true; } else { throw e; } }

in qpfdNet using job it's possible, wihtou having to catch an Exception.

Thanks

tfouto avatar Nov 28 '24 14:11 tfouto