Can we scroll to coordinates in page

it is possible to scroll into page number but is it possible to move to the given coordinate?


1 Reply 1 reply marked as answer

SK Shamini Kiruba Sobers Syncfusion Team October 29, 2021 01:03 PM UTC

Hi Tejinder, 

Greetings from Syncfusion support. 

We can move the scrollbar to the specified location using the goToBookmark method. Please refer to the below sample and code snippet. 


Code Snippet: 

<button (click)="navigate()">Navigate</button> 
<div class="control-section"> 
  <div class="content-wrapper"> 
    <ejs-pdfviewer 
      id="pdfViewer" 
      [serviceUrl]="service" 
      [documentPath]="document" 
      (documentLoad)="documentLoaded($event)" 
      style="height:640px;display:block" 
    ></ejs-pdfviewer> 
  </div> 
</div> 

  public documentLoaded(eLoadEventArgs): void { 
    this.pageSize = <any>JSON.parse(e.pageData).pageSizes; 
  } 

public navigate() { 
    var pdfviewer = (<any>document.getElementById('pdfViewer')) 
      .ej2_instances[0]; 
    var pageNumber = 3; 
    var pageIndex = pageNumber - 1; 
    var X = this.pageSize[pageIndex].split(' ')[1]; 
    var Y = 20; 
    pdfviewer.bookmarkViewModule.goToBookmark(pageIndexX - Y); 
  } 


Kindly try this and revert to us with more details if you have any concerns about this. 

Regards, 
Shamini 


Marked as answer
Loader.
Up arrow icon