Skip to content

user password IsEncrypted exception #3

@tfouto

Description

@tfouto

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions