Skip to main content
Known Participant
June 20, 2019
Answered

javascript to open specific page in other pdf doc

  • June 20, 2019
  • 2 replies
  • 1422 views

Heya everybody. I was playing around with one of my old docs and it uses the otherDoc javascript. Everything still works fine, but what I would like to add (to the button which opens the other doc), is to have the other doc opens but also opens to a specific page. I can't figure it out. Can someone help out with the javascript to make it work. This is a sample bit of script I'm using to open and transfer info from one doc to the other.

  case "WSPro":

        var myDoc = this ;

var otherDoc=app.openDoc("WSPro.pdf",this);

try {

otherDoc.getField("daName").value = myDoc.getField("daName").value

} catch(e) {}

etc, etc.

break;

I want, when WSPro.pdf opens that it will open to page 5 when I select it from myDoc. But, will open to page 1 when opens when opening the WSPro.pdf directly.

Thank you all for your time and help through the years.

This topic has been closed for replies.
Correct answer Bernd Alheit

otherDoc.pageNum = 4;

2 replies

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
June 20, 2019

otherDoc.pageNum = 4;

pdfUser1Author
Known Participant
June 21, 2019

Thank you too, Bernd. You're correct as well.

try67
Community Expert
Community Expert
June 20, 2019

Add this:

otherDoc.pageNum = 4;

pdfUser1Author
Known Participant
June 21, 2019

Thanks again, it's exactly what I wanted to do.