Skip to main content
Participant
Feb 17, 2016 8:32 PM UTC
Answered

Randomize pdf pages

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 is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Feb 17, 2016 8:37 PM UTC

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)));

}

12 replies

Participant
Nov 3, 2020 10:48 PM UTC

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. 

Translate
try67
Community Expert
Community Expert
Nov 3, 2020 11:00 PM UTC

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.

Translate
Legend
Oct 4, 2017 2:22 PM UTC

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.

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Feb 17, 2016 8:37 PM UTC

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)));

}

Translate
jasonp10Author
Participant
Feb 17, 2016 8:42 PM UTC

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

Translate
Participant
Oct 3, 2017 6:17 PM UTC

Did you get it to work?

Translate