Now I have to restore the annotations, this should be done each time the user changes the document page. So I added a handler to "PageChanged" event on GdViewer, to restore the annotations.
Given the name, I suppose the page is fully loaded when the event fires, but it appears that loading the annotation using LoadAnnotationsFromXMP cannot be done inside this event.
You can try with the included sample for the annotation:
Code: Select all
private void Form1_Load( System.Object sender, System.EventArgs e )
{
GdViewer1.SetLicenseNumber("xxxxxxxxxxxxxxxxxxxxxxxx");
BookmarksTree1.GdViewer = GdViewer1;
GdViewer1.PageChanged += new GdViewer.PageChangedEventHandler(GdViewer1_PageChanged);
}
void GdViewer1_PageChanged()
{
GdViewer1.LoadAnnotationsFromXMP( path to the xmp file );
}
No problem if LoadAnnotationsFromXMP is called after the document has been loaded (for example using a button).
Any workaround? I think it's quite important that we're able to restore annotation programmatically and for each page, otherwise we're limited to the first page only...
Regards