Skip to main content
New Participant
February 17, 2016
Answered

Randomize pdf pages

  • February 17, 2016
  • 3 replies
  • 11209 views

Hello all, thanks for taking the time to read this. Not sure if this is the most appropriate forum. I use notecards to study that I type in word and save as pdfs. They are all laid out the same: the odd numbered pages are the front and the next even page is the back. Is there a way to randomize a pdf document so that I can shuffle the deck, so to speak, such that it is always odd then odd+1?

If you are interested, I can send you a sample pdf of my notecards, I must have close to 10,000 of them from medical school through residency, but the lack of being able to shuffle them really does hinder studying a bit. I would definitely be willing barter for your help. Message me back and we can exchange emails. Thanks,

-jason

This topic has been closed for replies.
Correct answer try67

It's maybe not the best code in the world, but it should get the job done. Run it from the Console window, or attach it to a button to have easy access to it:

for (var p=0; p<this.numPages; p++) {

    this.movePage(p, Math.floor(Math.random()*(this.numPages-1)));

}

3 replies

New Participant
November 3, 2020

Is there any reason why this wouldn't work for an 18,000+ page .pdf? It was working for smaller page .pdfs for me, but this big one just spins the beach ball. 

try67
Adobe Expert
November 3, 2020

I would say it's probably too much for Acrobat to handle, unfortunately, although the Mac version (which I assume you have since you referenced the "beach ball") of Acrobat DC (and maybe 2020?) is 64-bit, so it should work better than the Windows one... But 18K+ pages might be too much, even for that.

Brainiac
October 4, 2017

Thanks for sharing that. Looks like a lot more work though. The console is in Acrobat Pro, search tools in Acrobat Pro DC for JavaScript.

try67
try67Correct answer
Adobe Expert
February 17, 2016

It's maybe not the best code in the world, but it should get the job done. Run it from the Console window, or attach it to a button to have easy access to it:

for (var p=0; p<this.numPages; p++) {

    this.movePage(p, Math.floor(Math.random()*(this.numPages-1)));

}

jasonp10Author
New Participant
February 17, 2016

Thanks for the quick reply! I'll let you know how it works.

New Participant
October 3, 2017

Did you get it to work?