# How to trigger GoTo method to redirect to a specific page once the document is loaded

**URL:** <https://pdfjs.community/t/how-to-trigger-goto-method-to-redirect-to-a-specific-page-once-the-document-is-loaded/854>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [June 28, 2021, 8:39am UTC](https://pdfjs.community/t/how-to-trigger-goto-method-to-redirect-to-a-specific-page-once-the-document-is-loaded/854 "2021-06-28T08:39:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gokul](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/gokul/32/413_2.png) [@Gokul](https://pdfjs.community/u/Gokul)\
**Post date:** [June 28, 2021, 8:39am UTC](https://pdfjs.community/t/how-to-trigger-goto-method-to-redirect-to-a-specific-page-once-the-document-is-loaded/854/1 "2021-06-28T08:39:00Z")

</div>

**PDF.js Express Version**  
7.3.1

**Detailed description of issue**  
Looking to redirect to a page when the document is loaded, got the page number from url params but how to trigger after load. Help me with the method to trigger with the action object

**Expected behaviour**  
Redirect to a specific page

**Does your issue happen with every document, or just one?**  
every document

**Link to document**

**Code snippet**  
Trying like this  
let goto = new Actions.GoTo({ dest: new Actions.GoTo.Dest({ page: jumpToAnnotation, }), });  
console.log(goto);

---

<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:** [June 28, 2021, 8:39am UTC](https://pdfjs.community/t/how-to-trigger-goto-method-to-redirect-to-a-specific-page-once-the-document-is-loaded/854/2 "2021-06-28T08:39:03Z")

</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:
- [Config files - Useful events](https://pdfjs.express/documentation/learn-more/advanced/config-files#useful-events)
- [What is PDF.js Express? - Load PDF.js Express Viewer from another domain](https://pdfjs.express/documentation/learn-more/inside-express-viewer#load-pdf.js-express-viewer-from-another-domain)
- [Understand coordinates in PDF.js Express - In practice](https://pdfjs.express/documentation/viewer/coordinates#in-practice)

APIs:
- [CoreControls.Bookmark - new Bookmark(children, name, pageNumber, parent, verticalOffset, horizontalOffset [, url] [, index])](https://pdfjs.express/api/CoreControls.Bookmark.html#Bookmark__anchor)
- [PartRetrievers.PartRetriever - setWithCredentials(withCredentials)](https://pdfjs.express/api/PartRetrievers.PartRetriever.html#setWithCredentials__anchor)
- [Actions~GoTo](https://pdfjs.express/api/Actions.GoTo.html#__anchor)

Forums:
- [Is it possible to get the document total page count from a WebViewer instance?](https://pdfjs.community/t/is-it-possible-to-get-the-document-total-page-count-from-a-webviewer-instance/771/1)
- [Get Current Viewer Coordinates](https://pdfjs.community/t/get-current-viewer-coordinates/569/3)
- [Want to read S3 bucket PDF object using bucket access key and secret key](https://pdfjs.community/t/want-to-read-s3-bucket-pdf-object-using-bucket-access-key-and-secret-key/83/3)

---

<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:** [June 29, 2021, 2:28pm UTC](https://pdfjs.community/t/how-to-trigger-goto-method-to-redirect-to-a-specific-page-once-the-document-is-loaded/854/3 "2021-06-29T14:28:59Z")

</div>

Hey there!

You can use the [docViewer.setCurrentPage](https://pdfjs.express/api/CoreControls.DocumentViewer.html#setCurrentPage__anchor) API to jump to a certain page.

Logan
