1 2 3 4 5 Previous Next 160 Replies Latest reply on Dec 29, 2015 10:26 AM by gkaiseril Go to original post
      • 150. Re: Print File Name with pdf Document
        Fer1403 Level 1

        Mr. Reinhardf Im using your script and I will like to change the code a little bit in order to get just some parts of the path,


        Ex. my actual path is something like /1/2/3/4/5/abc.pdf and will like to change the footer to something like 4/5/abc.


        1/2/3 will be always the same part of the path; all documents are in the same drive.


        I know I need to change this part of you code


        var re =/.*\/|\.pdf$/ig;
        var FileNM = this.path.replace(re,"")+".pdf";
        var Path = this.path;


        But I can’t get what I want.


        Any help will be appreciated



        • 151. Re: Print File Name with pdf Document
          interstate 8 Level 1

          Is it possible to print the the specific bookmark title/page title of each page in the footer of the pdf? 

          • 152. Re: Print File Name with pdf Document
            Jasonkzh Level 1

            Another method, but not using Java Script, and this method may applied to each single file only.


            • 153. Re: Print File Name with pdf Document
              WKLee_KC Level 1

              I have modified Java Script. This is to make footer as the bookmark name of each pages(only applies 1st level bookmarks). I use this script when I merge many files into one PDF.


              Please see below:


              app.addSubMenu({ cName: "BMKFooter",cUser: "BookMark Footer", cParent: "File", nPos: 21 });

              app.addMenuItem({ cName: "Set", cParent: "BMKFooter", cExec: "SetFooter(9)"});

              app.addMenuItem({ cName: "-------------------------------", cParent: "BMKFooter",cExec: "{}"});

              app.addMenuItem({ cName: "Remove", cParent: "BMKFooter", cExec: "RemoveFooter(9)"});

              //Set/remove Footer
              function SetFooter(ARG)
              var bmk = this.bookmarkRoot;
              var BMKName;
              var lastBMKPage=0;
              var currentBMKPage=0;
              var p=0;

              if(bmk.children != null){ 

              for(var i = 0; i < bmk.children.length; i++){ 


              lastBMKPage = this.pageNum-1; }
              else {lastBMKPage = this.numPages -1;}


              for ( p = currentBMKPage; p <= lastBMKPage; p++){

              var aRect = this.getPageBox("Crop",p);
              var TotWidth = aRect[2] - aRect[0]
              if (ARG==9)
                {var  fd = this.addField(String("xftDate"+p+1), "text", p, [30+TotWidth/2,15, TotWidth-30,40]);
                fd.value = " " + BMKName +" "; //print bookmark name
                fd.textSize=10; fd.readonly = true;

              currentBMKPage = lastBMKPage +1;


              function RemoveFooter(ARG)
              if (ARG==9)
              {for (var p = 0; p < this.numPages; p++)
              {var x = this.removeField(String("xftDate"+p+1));}
              //if (ARG==9)
              //{ for (var p = 0; p < this.numPages; p++)
              //{var x = this.removeField(String("xftPage"+p+1)); }
              //if (ARG<=3 || ARG==9) {var x = this.removeField("xftRem");}


              This is very late response. But I hope this is helpful for you.

              • 154. Re: Print File Name with pdf Document
                lhb1511@qq.com Level 1

                Hi ReinhardF!


                In Acrobat 9 Pro Batch, execute JavaScript, please provide a script to add the footer and displays the date and file name,
                Thank you very much!

                • 155. Re: Print File Name with pdf Document
                  saintjohnny Level 1

                  For googlers who find this thread down the road:



                  I made a tool to batch stamp PDF filenames.  You can get it here:






                  I've also added so that you can also stamp prefix/suffix before and after the filename, as well as stamp custom text ignoring filenames, and change the height of the stamp to go on the top of the page as a header if needed.  Since this isn't a true footer/header, it retains the information when combining PDFs later on which is a plus. 

                  • 156. Re: Print File Name with pdf Document
                    gina_block Level 1

                    Perhaps someone has already suggested this, but if you are using Acrobat Pro (I'm on 11.0.0), go to Tools (now located on the upper right of the PDF) > Print Production > Add Printer Marks > Page Information. This will place the filename on the lower left of your PDF. You can also add trim, reg marks, and color bars, etc.

                    • 157. Re: Print File Name with pdf Document
                      linnrokenes Level 1

                      The script to print filename in footer is great, but is there a way to print the filename ie in top or bottom center of the "selected view"?

                      • 158. Re: Print File Name with pdf Document
                        markwepl Level 1

                        I really don't understand all this Java Script stuff.  Why, oh why, is this not built into the basic product?  Seems like a NO BRAINER.  Absolutely should not take a programmer to do this simple task...


                        Just saying...

                        • 159. Re: Print File Name with pdf Document
                          gkaiseril MVP & Adobe Community Professional

                          One can use the add water mark from text to place the file name anywhere on the page. One could also add a field to any location on the page and set it's value to the file name.

                          • 160. Re: Print File Name with pdf Document
                            gkaiseril MVP & Adobe Community Professional

                            Acrobat is pretty well bloated so adding many features that are not commonly used would just add the bloat.


                            When PDfs were introduced, it was to be a type of universal cross platform document reader and only a few users has the tools to create PDFs, sort of like the original Mac and Lisa. In order to keep backward compatibility for all versions of PDFs Adobe has kept the original design and scripting, unlike MS Word that has more than once changed the VBA code.

                            1 2 3 4 5 Previous Next