5 Replies Latest reply on Jun 18, 2011 3:12 PM by LPrekop

    question: how to automatize `Page Number`-ing




      Lets say, I have a document of 150 pages divided to 150 pdf files with a numeric tag in it, from 1 to 150, for a start (that is what I have to deal with).
      The first 10 pages are the table of content, that is where I have to take actions (the document can contain any number of pages, 150-10 is just an example)


      first, I open the table of content pages and then I merge them into 1 document (Acrobat)
      then I go to: `file -> document properties -> open options`


      here in the `Page Number` field, I set the number to the page, where I want the merged document to be displayed at open as default, then I save the document 10 times overwriting the existing *.pdf files, every time set the `Page Number` field to be displayed in harmony with the file naming


      So now I have 10 completely identical documents containing the same 10 pages, the only difference, if u open them, they will pop on different initial page, as default.


      My very simple question is: is there a way (must be) to automatize this process? Unfortunately there are hundreds of them, and it is a really mindblowing experience to do this 8 hours a day


      There is a Plug-In, where I could create an action opening the `file -> document properties -> open options` and the `file -> Save As...` menu after each other, this way I only need to edit the `Page Number` field and then select the existing *.pdf file to save/overwrite it, but it is still time consuming and ineffective.



        • 1. Re: question: how to automatize `Page Number`-ing
          try67 MVP & Adobe Community Professional

          The real question is, why do you need 10 copies of the same file, each one

          with a different page as the default?

          • 2. Re: question: how to automatize `Page Number`-ing
            dhoult Level 1

            After reading it several times, I think this is what you're saying:

            1.) Merge 10 different files into one complete "Table of Contents."

            2.) Save the new "Table of Contents" 10 times, with 10 different file names.

            3.) Each of the 10 files will automatically open to a different page.


            Please consider revising your wording... I don't think I really understand what you want to do.

            • 3. Re: question: how to automatize `Page Number`-ing
              nprekop Level 1

              Basicly yes, that is it.


              I described it a littlebit more, cus my hands are tied, this is the way it is since years at the company. Means cannot really change anything in the process, even if it would give a better result, but I would like to find a solution, if there is one. Probably need a small add-on or program to be written for this, what is an option, in case anyone can do it, but i guess that has to go private, not a forum topic as soon as it comes to business.



              • 4. Re: question: how to automatize `Page Number`-ing
                BarlaeDC Level 4

                Hi ,


                Have you looked at the Batch processing of Acrobat as I think it might be able to do what you want.


                Acrobat 9 details -

                http://help.adobe.com/en_US/Acrobat/9.0/Professional/WS58a04a822e3e50102bd615109794195ff-7 c52.w.html


                It has changed its name and location in Acrobat X but the idea is still the same.


                Hope this helps



                • 5. Re: question: how to automatize `Page Number`-ing
                  LPrekop Level 1

                  Hi Malcolm,


                  Thanks for your idea. The problem is that Nandor needs to set the Open to Page depending on the filename, ie. file0004.pdf should show page 4 when opened in Acrobat.


                  Let me explain. Initially there is a folder with an unknown amount of PDF-s in it, named as file0001.pdf, file0002.pdf, ... file0158.pdf etc. All of these pdf-s only contain one page.


                  The automation should do the following:


                  1. merge the first few pdf-s (they can be identified easily: only these pdf-s contain ... (ellipsis characters), save this merged pdf as file0001.pdf, overwrite the original). This is the TOC of a manual.
                  2. make copies from the merged pdf (TOC) acccording to the total page of the TOC, naming them as file0002.pdf, file0003.pdf – effectively replacing each single paged pdf with the multipaged TOC.
                  3. at the same time set the Open to Page attribute of each TOC clone according to the filename ie. page 4 for file0004.pdf.



                  I wrote a JS which can make the copies from the merged TOC, and tried to set the pageNum as well, but it fails (strangely enough the last pdf works perfectly, it opens to the right page).


                  Here is my script:



                  // Make copies with different Open to Pages

                  //determine  the amount of pages in the document

                  var tocPages = this.numPages+1;    //+1 for filenaming

                  //truncate the end of the filename

                  var myFileName=this.path.slice(0, path.length - 8);

                  // Saving copies of the document according to page number

                  for (var i = 2; i < tocPages; i++) {

                  //set the Open to Page  <------- FAILS?

                  this.pageNum = i;

                  //Padding pageNum with zeroes for filename

                  var paddedI = pad(i,4);

                         //make the filename

                  this.saveAs(myFileName+ paddedI + ".pdf");


                  // Pad a number with leading zeroes ie. 0001, 0023, 000056

                  function pad(n, len) {

                  s = n.toString();

                  if (s.length < len) {

                  s = ('0000000000' + s).slice(-len);


                      return s;




                  I suspect that pageNum() is just a runtime method to jump to a page, and I should hardwire it into the PDF somehow (document level JS?). But I don't know how can I attach a JS to a pdf from javascript. Or maybe pageNum() is not the property what I need here...