This example demonstrates how to lock the document with a password using ByteScout PDF SDK. PDF format supports two kinds of passwords: owner and user password. User password allows to view document and perform allowed actions. Owner password allows everything, including changing passwords and permissions. Program.vb: VB Program.cs: C# .