For finer control you can talk to the viewer directly through its API instead of only reacting to events.

Getting a reference. Use @ViewChild to obtain the StimulsoftViewerComponent instance:
import { Component, ViewChild } from '@angular/core';
import { StimulsoftViewerComponent } from 'stimulsoft-viewer-angular';

export class AppComponent {
    @ViewChild('viewer') viewer: StimulsoftViewerComponent;
}

Calling the API from the template. The viewer.api object exposes the viewer's state and methods, which you can bind to directly:
Zoom is {{ viewer.api.zoom }}<br />
Current page {{ viewer.api.currentPage + 1 }}<br />
<input type="button" (click)="viewer.api.zoom = 50" value="Zoom to 50%" />
<input type="button" (click)="viewer.api.export('Pdf', { ImageResolution: 200 })" value="Export to PDF" />

<stimulsoft-viewer-angular #viewer
    [requestUrl]="'/Viewer/{action}'" [action]="'InitViewer'" [height]="'100vh'">
</stimulsoft-viewer-angular>

The API used here:



Because Angular's template binding re-reads these values on each change-detection cycle, the displayed zoom and page number stay in sync with what the user does in the viewer.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.