I have created a pdf document and I need to protect the document with password.
Document document = new Document(PageSize.A4.Rotate(), 10, 10, 10, 10);
string pdfFilename = "dbtopdf.pdf";
PdfWriter.GetInstance(document, new FileStream(pdfFilename, FileMode.Create));
PdfPTable table = new PdfPTable(13);
foreach (abccreation obj in list)
{
"Adding cell here... Not related"
}
document.Open();
document.Add(table);
document.Close();
Would like to ask is there a way to add a password into the document. So it will prompt user to enter password when the user is trying to read this.
I have try to apply the to a pdf file with
pdf.SecuritySettings.UserPassword = "your password";
But somehow this document i created is not a pdf file so the same technic cannot be apply.