I need put one custom icon in different page of my document and call some function to open popup with html content.
I made a rectangle over page 1 with this code:
var am = me.docViewer.GetAnnotationManager();
var rectAnnot = new Annotations.RectangleAnnotation();
rectAnnot.X =(500);
rectAnnot.Y =(100);
rectAnnot.Width =(100);
rectAnnot.Height =(100);
rectAnnot.PageNumber = 2;
rectAnnot.Author = this.currUser;
rectAnnot.FillColor = new Annotations.Color(0,255,0);
rectAnnot.StrokeColor = new Annotations.Color(255,0,0);
rectAnnot.StrokeThickness = 1;
am.AddAnnotation(rectAnnot);
How can I call my popup function?
I use HTML5mobile version.
Thanks
Let me try explain better
I'm trying to create a button in a page of my XOD, to open a custom popup. I know how to create the popup from jquery, but I do not know how to insert the button on a specific page and then call my function to open the popup.
I created a rectangle within a page, but clicking on it shows me the options (see attached link).
https://drive.google.com/file/d/0ByCYKBzkkpYiVDdoQ2EyZ2JqNEU/edit?usp=sharing
How can create a button on a document page that calls a function that opens a custom popup?
Thanks
this.showNotePopup(rectAnnot);
if (pageIndex === 0) {
var container = $('#pageContainer' + pageIndex).parent();
var location = me.displayMode.PageToWindow({x: 100, y: 100}, pageIndex);
var pageTransform = me.displayMode.GetPageTransform(pageIndex);
var pageOffset = me.displayMode.GetPageOffset(pageIndex);
var offset = {
left: pageOffset.x - pageTransform.x,
top: pageOffset.y - pageTransform.y
};
var div = $('<div>')
.css({
'position': 'absolute',
'z-index': 100,
'top': location.y + offset.top,
'left': location.x + offset.left
})
.text('Some Text');
var button = $('<button>Open Popup</button>')
.on('click', function() {
alert("Opening my popup");
});
div.append(button);
container.append(div);
}