# How do i dynamically route to a specific page after pdf loads

**URL:** <https://pdfjs.community/t/how-do-i-dynamically-route-to-a-specific-page-after-pdf-loads/1315>\
**Category:** Technical Support\
**Created:** [January 19, 2022, 6:26pm UTC](https://pdfjs.community/t/how-do-i-dynamically-route-to-a-specific-page-after-pdf-loads/1315 "2022-01-19T18:26:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user61](https://avatars.discourse-cdn.com/v4/letter/u/c37758/32.png) [@user61](https://pdfjs.community/u/user61)\
**Post date:** [January 19, 2022, 6:26pm UTC](https://pdfjs.community/t/how-do-i-dynamically-route-to-a-specific-page-after-pdf-loads/1315/1 "2022-01-19T18:26:50Z")

</div>

**Which product are you using?**

**PDF.js Express Viewer**

**Detailed description of issue**  
I want to route to a specific page when pdf loads. For example i want page number 10 to be shown instead of 1.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [January 19, 2022, 6:26pm UTC](https://pdfjs.community/t/how-do-i-dynamically-route-to-a-specific-page-after-pdf-loads/1315/3 "2022-01-19T18:26:55Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [Real-time collaboration client](https://pdfjs.express/documentation/collaboration/realtime-collaboration-client.8)
- [Page Manipulation](https://pdfjs.express/documentation/advanced/page-manipulation)
- [Open a document from base64 data](https://pdfjs.express/documentation/basic-operations/open-document/base64)

APIs:
- [Core.Document - loadCanvasAsync(options)](https://pdfjs.express/api/Core.Document.html#loadCanvasAsync__anchor)
- [Utils - setCanvasMultiplier(value)](https://pdfjs.express/api/7.0/utils.html#setCanvasMultiplier__anchor)
- [CoreControls.Document - removePages(pageArray)](https://pdfjs.express/api/7.0/CoreControls.Document.html#removePages__anchor)

Forums:
- [How to trigger GoTo method to redirect to a specific page once the document is loaded](https://pdfjs.community/t/how-to-trigger-goto-method-to-redirect-to-a-specific-page-once-the-document-is-loaded/854/1)
- [Navigating to a certain pdf page number using Hyperlinks on the pdf file not working on pdfjs webviewer](https://pdfjs.community/t/navigating-to-a-certain-pdf-page-number-using-hyperlinks-on-the-pdf-file-not-working-on-pdfjs-webviewer/1234/1)
- [Annotations loads before file loads even if we use ‘documentLoaded’ event](https://pdfjs.community/t/annotations-loads-before-file-loads-even-if-we-use-documentloaded-event/67/1)

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [January 20, 2022, 3:47pm UTC](https://pdfjs.community/t/how-do-i-dynamically-route-to-a-specific-page-after-pdf-loads/1315/4 "2022-01-20T15:47:03Z")

</div>

Hey!

You can use the [setCurrentPage](https://pdfjs.express/api/Core.DocumentViewer.html#setCurrentPage__anchor) API for this.

```javascript
WebViewer(...).then(instance => {

  const { documentViewer } = instance.Core;

   documentViewer.addEventListener('documentLoaded', () => {
       documentViewer.setCurrentPage(10)
   })

})

```

Thanks,  
Logan

---

<div class="post-metadata">

**Author:** ![user61](https://avatars.discourse-cdn.com/v4/letter/u/c37758/32.png) [@user61](https://pdfjs.community/u/user61)\
**Post date:** [January 21, 2022, 6:45am UTC](https://pdfjs.community/t/how-do-i-dynamically-route-to-a-specific-page-after-pdf-loads/1315/5 "2022-01-21T06:45:07Z")

</div>

Thanks logan it works

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [January 24, 2022, 6:35pm UTC](https://pdfjs.community/t/how-do-i-dynamically-route-to-a-specific-page-after-pdf-loads/1315/6 "2022-01-24T18:35:47Z")

</div>


