Skip to main content
daved42592281
Participant
March 17, 2019
Answered

Auto-select correct month/page using system date

  • March 17, 2019
  • 2 replies
  • 785 views

I have a 12-page PDF calendar (1 page for each month).  How do I use javascript inside the PDF file to auto-select the current month page to display based on the user system date (month).  I am trying to display the current month of our club calendar that is launched from our webpage when the user selects "Calendar".

Presently, the PDF always displays the first page of the PDF file (January), and users must scroll down to select the current month.

This topic has been closed for replies.
Correct answer try67

Add this code as a doc-level script:

this.pageNum = new Date().getMonth();

2 replies

daved42592281
Participant
March 17, 2019

Entered the script from Try67 - saved and re-opened.  Still opening on initial first page.  What else is needed?

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 17, 2019

Add this code as a doc-level script:

this.pageNum = new Date().getMonth();

daved42592281
Participant
March 17, 2019

Entered script as written - saved file and re-opened.  PDF is still opening on initial page.  What else is needed to execute the code?

try67
Community Expert
Community Expert
March 17, 2019

Nothing else is needed. Where did you enter it, exactly?