Hello,
I’m trying to implement annotation subscriptions for tracing who made what with annotation and who comments on annotations. First i tried it in our project. Until now we were running annotations under guest account. When you made a change it saved as guest. Now we want to implement subscription to tracing. I’m doing it like below, after annotation control created.
private bool LoadAnnotationMode(Stream stream, string filename)
{
container.Attributes.Add(“IsAnnotation”, “1”);<span style="color:#2b91af;">Control</span> ph = <span style="color:blue;">this</span>.Page.FindControl(<span style="color:#a31515;">"phViewerScripts"</span>); ph.Controls.Clear(); ph.Controls.Add(<span style="color:blue;">new</span> <span style="color:#2b91af;">LiteralControl</span>(<span style="color:blue;">new</span> <span style="color:#2b91af;">WidgetFactory</span>().AnnotationScripts().UseHttpHandlers(<span style="color:blue;">true</span>).ToString())); <span style="color:blue;">var</span> annotate = <span style="color:blue;">new</span> <span style="color:#2b91af;">WidgetFactory</span>().Annotation() .Stream(stream, filename) .AccessRights(Rights) .AnyToolSelection(AnyToolSelection) .ClickableAnnotations(ClickableAnnotations) .ElementId(<span style="color:#a31515;">"divHTML5ViewerContainer"</span>) .EnableRightClickMenu(<span style="color:blue;">false</span>)<span style="color:green;">// default browser sağ tık menüsü açıyor. Sabit false değeri olacak.</span> .EnableSidePanel(EnableSidePanel) .EnableTabNavigation(EnableTabNavigation) .EnableTextSelection(EnableTextSelection) .EnableTooltips(EnableTooltips) .EnableUndo(EnableUndo) .OpenThumbnails(OpenThumbnails) .PreloadPageCount(PreloadPagesCount) .PrinterSetup(<span style="color:#2b91af;">PrintViewComponents</span>.All) .SaveReplyOnFocusLoss(SaveReplyOnFocusLoss) .ScrollOnFocus(ScrollOnFocus) .ShowFileExplorer(<span style="color:blue;">false</span>)<span style="color:green;">//default false</span> .ShowHeader(ShowHeader) .ShowPaging(ShowPaging) .ShowPrint(ShowPrint && hasPrintPermission) .ShowThumbnails(ShowThumbnails) .ShowToolbar(ShowToolbar) .ShowZoom(ShowZoom); <span style="color:blue;">if</span> (ZoomMode.Equals(<span style="color:#a31515;">"FitToWidth"</span>, <span style="color:#2b91af;">StringComparison</span>.InvariantCultureIgnoreCase)) { annotate.ZoomToFitWidth(<span style="color:blue;">true</span>); } <span style="color:blue;">else</span> { annotate.ZoomToFitHeight(<span style="color:blue;">true</span>); } <span style="color:blue;">if</span> (<span style="color:blue;">string</span>.IsNullOrWhiteSpace(Locale)) { <span style="color:blue;">string</span> userLang = <span style="color:#2b91af;">WebUtilities</span>.GetUserLanguage(); <span style="color:blue;">string</span> defaultLang = <span style="color:#2b91af;">MultiLanguageWeb</span>.MultiLanguageDictionary.DefaultLanguage; <span style="color:blue;">string</span> lang = supportedLocales.ContainsKey(userLang) ? userLang : (supportedLocales.ContainsKey(defaultLang) ? defaultLang : <span style="color:blue;">string</span>.Empty); <span style="color:blue;">if</span> (!<span style="color:blue;">string</span>.IsNullOrEmpty(lang) && supportedLocales.ContainsKey(lang)) { annotate.Locale(supportedLocales[lang]); } } <span style="color:blue;">else</span> { annotate.Locale(Locale); } container.InnerHtml = annotate.ToHtmlString(); container.Attributes.Add(<span style="color:#a31515;">"IsLoaded"</span>, <span style="color:#a31515;">"1"</span>); <span style="color:#2b91af;">IAnnotationService</span> svc = <span style="color:#2b91af;">ObjectFactory</span>.GetInstance<<span style="color:#2b91af;">IAnnotationService</span>>(); svc.AddCollaborator(filename, <span style="color:#2b91af;">Globals</span>.User.Email, <span style="color:#2b91af;">Globals</span>.User.FirstName, <span style="color:#2b91af;">Globals</span>.User.LastName, <span style="color:blue;">null</span>); <span style="color:blue;">return</span> <span style="color:blue;">true</span>; }</pre>When i control the database tables(Users and AnnotationCollabrators tables) datas are correct as it should be. But still when i made a comment or, reply a comment it still do it as guest.<br><br>After that i thought i'm missing something and i found your example for using annotation and viewer together. In that demo you use Anonym A. user and it works great then i changed it as <br><pre style="font-family:Consolas;font-size:13;color:black;background:white;">svc.AddCollaborator(<span style="color:#a31515;">"candy.pdf"</span>, <span style="color:#a31515;">"groupdocs2@groupdocs.com"</span>, <span style="color:#a31515;">"Anonym2"</span>, <span style="color:#a31515;">"A2."</span>, <span style="color:blue;">null</span>); <span style="color:green;">// allow anonymous users to annotate on a document<br></span></pre>Then i tried it again but the results are the same. It still make comments as Anonym A. not Anonym2 A2.<br><br>I tried to clear browser history but it didn't solve the problem.<br><br>You can download demo project from <a rel="nofollow" href="https://www.dropbox.com/s/z8gnkqubz36yaw7/ViewerAndAnnotationWebForms.rar?dl=0">here</a>, you can check it from demo.<br>Am i doing it wrong or what am i missing?<br><br>Kind regards,<br>