Applying privileges to make PDF not editable removes watermark stamp

This successfully applies the DRAFT watermark on all pages:

using (var pdfDocument = new Aspose.Pdf.Document(sourceStream))
                            {
                                using (var watermarkStream = await watermarkBlobClient.OpenReadAsync())
                                { 
                                    var fileStamp = new PdfFileStamp();
                                    fileStamp.BindPdf(pdfDocument);
                                    // Create stamp
                                    var stamp = new Stamp();
                                    stamp.BindImage(watermarkStream);
                                    stamp.SetOrigin(-180, -50);
                                    stamp.Rotation = 45.0F;
                                    stamp.IsBackground = false;

                                    // Add stamp to PDF file
                                    fileStamp.AddStamp(stamp);
                                    using (var writeStream = await reportDocBlobClient.OpenWriteAsync(true))
                                    {
                                        fileStamp.Save(writeStream);
                                    }

                                    fileStamp.Close();
                                }
                            }

This makes the PDF not editable, but removes the watermark stamp:

using (var pdfDocument = new Aspose.Pdf.Document(sourceStream))
                        {
                            //Forbid all privileges on the document
                            var privilege = DocumentPrivilege.ForbidAll;
                            privilege.AllowPrint = true;
                            privilege.AllowCopy = true;
                            var fileSecurity = new PdfFileSecurity();
                            fileSecurity.BindPdf(pdfDocument);
                            fileSecurity.SetPrivilege(privilege);

                            using (var writeStream = await reportDocBlobClient.OpenWriteAsync(true))
                            {
                                pdfDocument.Save(writeStream);
                            }
                        }

@brooksclarkpwc,

Here is a sample code done in the latest version of Aspose.PDF API.

private void Logic()
{
    Document doc = new Document($"{PartialPath}_input.pdf");

    TextStamp textStamp = new TextStamp("Watermark Text");
    textStamp.TextState.Font = FontRepository.FindFont("Arial");
    textStamp.TextState.FontSize = 24;
    textStamp.TextState.ForegroundColor = Color.LightGray;

    textStamp.RotateAngle = 45;
    textStamp.Opacity = 0.5;
    textStamp.HorizontalAlignment = HorizontalAlignment.Center;
    textStamp.VerticalAlignment = VerticalAlignment.Center;

    ImageStamp imageStamp = new ImageStamp($"{PartialPath}_watermark.jpg");
    imageStamp.HorizontalAlignment = HorizontalAlignment.Center;
    imageStamp.VerticalAlignment = VerticalAlignment.Center;            
    imageStamp.Opacity = 0.5;

    foreach (Page page in doc.Pages)
    {
        page.AddStamp(imageStamp);
        page.AddStamp(textStamp);
    }


    // Set the document permissions to disallow editing
    var privilegies = DocumentPrivilege.AllowAll;
    privilegies.AllowModifyContents = false;
    privilegies.AllowModifyAnnotations = false;            

    var fileSecurity = new PdfFileSecurity();
    fileSecurity.BindPdf(doc);
    fileSecurity.SetPrivilege(privilegies);

    doc.Save($"{PartialPath}_output.pdf");
}

Here are the files used:
AddingPrivilegeRemoveWatermark_input.pdf (3.0 KB)
AddingPrivilegeRemoveWatermark_watermark.jpg (666.0 KB)
AddingPrivilegeRemoveWatermark_output.pdf (2.1 MB)