You can set an owner/permissions/master password and a user/open password for a PDF files at the same time. Below is a sample showing how to set both types of passwords for one PDF file:
To download the tool, please click VeryPDFToobox.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Call_PDFToolBoxCom
{
class Program
{
static void Main(string[] args)
{
string strExePath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
PDFToolBoxCom.PDFToolBoxCom p = new PDFToolBoxCom.PDFToolBoxCom();
string strReturn = p.RunCMD(strExePath + @"\1.pdf -outfile "+ strExePath + @"\out.pdf -ownerpassword opwd -userpassword upwd");
Console.WriteLine(strReturn);
Console.WriteLine("Please enter any key to continue...");
Console.ReadKey();
}
}
}
______________________
Lear more: VeryPDF PDF Toolbox Component for .NET.