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
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