Skip to main content
Participating Frequently
December 16, 2019
Answered

Rearranging pages in Acrobat by specific keywords in the text

  • December 16, 2019
  • 2 replies
  • 22133 views

Thanks in advance for help anyone can give. I'm trying to figure out how to rearrange pages by keywords already in the text. For example: We have a PDF with 100 invoices for band books and want to arrange them by instrument. Using the search function, I can find every place the word "Flute, or Trumpet" appears, but I'm hoping to find a way to search for "Flute" and then move those pages together to the top of the PDF. Repeating this for each instrumentation until all 100 pages are rearranged in the order we need.

 

The only way I know of to rearrange pages, is by selecting each thumbnail (either in the thumbnail preview bar at the side, or in the "organize pages" function) and manually moving them into place. A few searches I've done lead me to think I need to use some sort of Script? I'm still in the learning phase, and don't understand yet what that means. 

This topic has been closed for replies.
Correct answer bebarth

Thanks a lot for helping. I will be waiting for modified script.


Hi,

Here is a new file with an action wizard and a field with the script.

Previously I told you somethin wrong ("In this script the word is used as a variable"). This is something I though to do but I didn't. So you can look for "2 Black Titans"... and you can (normally) search from 1 up to several numbers of words.

@+

 

2 replies

Thom Parker
Community Expert
Community Expert
December 16, 2019

Creating scripts to finding words on a page, and then rearrange those pages is possible, but it is an advanced task. To create a complete solution you'll neet to either learn Acrobat scripting or engage a developer. 

 

There are some free tools that may help you. You'll find a list of free "Acrobat Actions" here:

https://acrobatusers.com/actions-exchange

 

The very last one finds and highlights words. This at least gets you part of the way. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participating Frequently
December 16, 2019

Thanks for your help - I downloaded this action, and unfortunately it does the same thing that the basic search function already does in Acrobat and adds a highlight. Maybe the action I am trying to execute doesn't exist.

bebarth
Community Expert
Community Expert
April 26, 2022

Can we edit this script to sort the PDF file according to 3 different choices?

Like if we have word "Titans" all pages should be first, then "Origin" and then "Snap" in the same PDF file. Is that possible, if yes how? 

Kindly, I need your help if you can. Thanks!

 


Hi,

You will find an action wizzard and the script in the attached file.
If you wish more or less words, you just have to modify the "theWords" table.

var theWords=["Titans","Origin","Snap"];

@+

bebarth
Community Expert
Community Expert
December 16, 2019

Hi,

If you know the position of the word you are looking for (in a title at the top of the page for example), you can check it with a script then store the page numbers and then re-arrange the position of the pages of your document.

This is something I already did.

@+

 

Participating Frequently
December 16, 2019

I know nothing about what JavaScritpt does, and how to use it function in Acrobat. Any reccommendations for video tutorials would be wonderful. I haven't had much luck just playing around with it in some of my practice documents. The keywords I would like to search and sort by, aren't always located in the same position on each page. Does this matter. 

 

Sorry in advance, my questions may be pretty basic. 

bebarth
Community Expert
Community Expert
December 16, 2019

So you can check all the pages where are located the word you are looking for...

Is it feasible?

@+