Capture click event and save the Annotated document to a memory-stream in C#

Walking thru the “GroupDocs.Annotation for .NET WebForms” sample project, I see the LoadDocumentPage() action-method in the AnnotationApiController get data via memory-stream.

In the Angular client app 's root component, a custom selector <gd-annotation-app> is placed in the template without any supporting code in the code-behind.

With all annotation functions implemented as a node-module, instead of using the defaultDocument setting in configuration.yml, is it possible to implement codes in the Angular client app 's root component to specify a specific document to be loaded?

And, after annotations’ been added, is it possible to implement codes in the Angular client app’s root component to capture click event and save the “annotated” document to a memory-stream?

If so, can you provide sample codes to accomplish the above tasks?

Sam

@samuelphung

We are looking into this scenario. Your investigation ticket ID is ANNOTATIONNET-1954.

(question to accomplish same objective as the original question, in different context)
In the “GroupDocs.Annotation for .NET WebForms” sample project 's Angular client app, the component is placed in the app 's root component, with all of the annotation UI functions encapsulated in a node-module (@groupdocs.examples.angular), in the \node_modules folder.

Instead of the “defaultDocument” setting in configuration.yml, Is it possible to pass certain parameter to the Angular app, via query-parameters, for the Angular app to load a specific document? if so, how?

@samuelphung

Alright. Please keep track of this GitHub issue. However, we’ll notify you here as well in case of any update.

@samuelphung

We’ve a workaround for you:

How to setup a file to upload programmatically?

You can do this via _annotationService. You could add following code after constructor in app.component.ts:

_annotationService.upload(null, "https://softmap.ru/upload/uf/f44/f44385fcaae32331408c179d25ff6072.png", true).subscribe((data) => {
        this.selectDir("");
        this.selectFile(data["guid"], "", "");
});

You need to add click handler on component where you want to handle clicks (for instance on document):

<div class="doc-panel" *ngIf="file" (click)="onClick($event)" ... >

Then in app.component.ts need to create a method that will be called on click. For instance

onClick($event: any) {
  console.log('Click occured', $event);
}

You cannot do this in the UI application. However, in AnnotationApiController.cs you could write your own code similar to DownloadAnnotated method but instead it must return base64\stream any such thing that you want.