Hi
I’ve added a colour box to my page and following examples I found here am trying to add a popup annotation.
It works but in Acrobat Reader the popup isn’t read only and the user gets a reply button. I’ve attached an example and the code below is what I’m using. If they do try to reply all manner of weird flickering happens.
Ultimately when they hover over the coloured rectangle I want it to just popup a window with the title and comments and nothing else, no reply button etc. Tried all sorts of flags but can’t seem to get it to work.
Also once you’ve hovered over and leave it leaves a dashed border behind, how do I remove that too?
string name = $"TXTANNOT{pageCount}";
string title = "Notes";
string comment = "Some notes the user entered";
var height = pdf.PageInfo.Height;
var actualRect = new Aspose.Pdf.Rectangle(73, height - 230, 526, height - 174);
var popupRect = new Aspose.Pdf.Rectangle(73, height - 230, 526, height - 174);
var text = new Aspose.Pdf.Annotations.TextAnnotation(page, actualRect);
text.Name = name;
text.Title = title;
text.Contents = comment;
text.Flags = Aspose.Pdf.Annotations.AnnotationFlags.NoView | Aspose.Pdf.Annotations.AnnotationFlags.ReadOnly;
page.Annotations.Add(text);
var popup = new Aspose.Pdf.Annotations.PopupAnnotation(page, popupRect);
page.Annotations.Add(popup);
text.Popup = popup;
popup.Parent = text;
var field = new Aspose.Pdf.Forms.ButtonField(page, actualRect);
pdf.Form.Add(field);
string fieldName = field.PartialName;
string openScript = "var t = this.getAnnot(this.pageNum, '" + name + "'); t.popupOpen = true; var w = this.getField('" + fieldName + "'); w.setFocus();";
string closeScript = "var t = this.getAnnot(this.pageNum, '" + name + "'); t.popupOpen = false;";
field.Actions.OnEnter = new Aspose.Pdf.Annotations.JavascriptAction(openScript);
field.Actions.OnExit = new Aspose.Pdf.Annotations.JavascriptAction(closeScript);
Any help would be appreciated
example.pdf (184.1 KB)