How to open pdf with jump to particular page in embed adobe api? | Community
Skip to main content
October 24, 2020
Solved

How to open pdf with jump to particular page in embed adobe api?

  • October 24, 2020
  • 2 replies
  • 7103 views

I implemented the adobe embed api in Angular using Angular sample, now I want to jump to a particular page

 

Example: I opened example.pdf it has 14 pages and I want to jump to the 3rd page, how can I do that.

 

In this https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDFOpenParameters.pdf , I saw the property of page which we can add after pdf URL like example.pdf#page=3 so it will directly jump to 3rd page of that pdf.

 

But when I implement that property it won't jump to that page

 

Any suggestions for this are appreciated, Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by imvikaskohli

Finally able to jump to a particular page using the goToLocation function in adobe embed api.

For reference please check, https://www.adobe.io/apis/documentcloud/dcsdk/docs.html?view=view 

const previewFilePromise = this.pdfRef = this.adobeDCView.previewFile({

 content: {

   location: {
     url: fileName, 

    }

  },

 metaData: {

   fileName: 'my file.pdf',

   id: "filed"

 }

},viewerConfig);

previewFilePromise.then((adobeViewer:any) => {

   adobeViewer.getAPIs().then((apis:any) => {
     apis.gotoLocation(<Page_Number>, <X_Coordinate>, <Y_Coordinate>)
        .then(() => console.log("Success"))

        .catch((error:any) => console.log(error));
    });

})

X and Y coordinates are optional, so using this function we can go to any page inside iframe using our own custom button

 

 

 

2 replies

santhosh_kumark
Level 6
October 24, 2020
October 24, 2020
I checked this it won't work
imvikaskohliAuthorAccepted solution
October 24, 2020

Finally able to jump to a particular page using the goToLocation function in adobe embed api.

For reference please check, https://www.adobe.io/apis/documentcloud/dcsdk/docs.html?view=view 

const previewFilePromise = this.pdfRef = this.adobeDCView.previewFile({

 content: {

   location: {
     url: fileName, 

    }

  },

 metaData: {

   fileName: 'my file.pdf',

   id: "filed"

 }

},viewerConfig);

previewFilePromise.then((adobeViewer:any) => {

   adobeViewer.getAPIs().then((apis:any) => {
     apis.gotoLocation(<Page_Number>, <X_Coordinate>, <Y_Coordinate>)
        .then(() => console.log("Success"))

        .catch((error:any) => console.log(error));
    });

})

X and Y coordinates are optional, so using this function we can go to any page inside iframe using our own custom button

 

 

 

kautuk_sahni
Community Manager
Community Manager
October 26, 2020
Thank you for sharing this with community. This would help others in the future.
Kautuk Sahni