1 2 3 4 5 4 Previous Next 156 Replies Latest reply: Nov 13, 2014 12:12 PM by gina_block Go to original post RSS
      • 150. Re: Print File Name with pdf Document
        Fer1403 Community Member

        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 Community Member

          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 Community Member

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

            http://www.uwec.edu/help/Acrobat9/for-date.htm

            • 153. Re: Print File Name with pdf Document
              WKLee_KC Community Member

              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++){ 

              BMKName=bmk.children[i].name;

              if(i<=bmk.children.length-2){
              bmk.children[i+1].execute();
              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;
                fd.alignment="right";
                }

              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 Community Member

                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

                  For googlers who find this thread down the road:

                   

                   

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

                   

                   

                  http://saintjohnny.com/pdffilenamelabeler

                   

                   

                  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 Community Member

                    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.

                    1 2 3 4 5 4 Previous Next