Hi, how can i add a will print event using pdfsharp? i am trying to add make it so that it can add a watermark if anyone tries to print the pdf. according to pdfreference, i need to add AA catalog but i dont know how to proceed from there. here is my code to try adding the willprint event.
Code:
string action = "app.alert(\"Hello!\", 3);";
dict.Elements["/S"] = new PdfName("/O");
dict.Elements["/JS"] = new PdfStringObject( document , action);
document.Internals.AddObject(dict);
document.Internals.Catalog.Elements["/AA"] = PdfSharp.Pdf.Advanced.PdfInternals.GetReference(dict);
any help is appreciated.