Stamp File Names on PDFs with this Free Acrobat X Action

Acrobat offers a number of ways to stamp information on documents using either the Headers/Footers function or Bates Stamping.

Unfortunately— out of the box— Acrobat does not allow you to stamp the document File Name on the document very easily.

Why would I need to stamp a file name on the document?

There are a number of legal workflows (discovery, exhibit preparation) that may result in the renaming of files. Preserving the original file name may be important so that you can establish the provenance of a file.

In addition to the file name, PDF documents also have a Document Title property which is different than the file name.

You can view the Document Title property of a PDF by choosing File> Properties and clicking on the Properties tab:

The Document Properties tab of Acrobat X

Fortunately, Acrobat X Pro Actions come to the rescue!

With a bit of JavaScript, we’ve put together a useful add-on for anybody who wants to stamp filenames on documents.

Acrobat X File Name Stamper Action

The Acrobat X File Name Stamper Action automates the process of stamping:

  • File Name
  • File Name + Date
  • Document Title
  • User-entered text

When you run the Action, you’ll be asked to select the files you wish to process. Then, you can choose various options in the Actions window:

Acrobat X File Name Stamper Options

How do I get the File Name Stamper Action?

You can get the Filename Stamper Action over on the Actions Exchange on,

Alternately, you can download it direct below.

The PDF document you download below includes:

  1. Installation and use instructions
  2. Action (embedded in the PDF)


Filename_Stamper.pdf (682K)


Right-click and Choose Save Target As . . . to save to your desktop

You will need Acrobat X Pro to run the Action

23 Responses to Stamp File Names on PDFs with this Free Acrobat X Action

  1. Shimmess says:

    is there any way to apply the filename without the .pdf part?

  2. You can apply the filename without the “.pdf” part, with this Javascript:


    /* TruncatedFilename_Singlepage */
    var truncatedFileName = this.documentFileName.replace(/\.pdf$/i, “”);
    var pageAmount = this.numPages;

    cText: truncatedFileName,
    nStart: 0,
    nEnd: 0,
    nFontSize: 13,
    nTextAlign: app.constants.align.right,
    nHorizAlign: app.constants.align.right,
    nHorizValue: -25, nVertValue: -15

    This is handy if you have a bunch of files named “Exhibit 1.pdf”, “Exhibit 2.pdf”, etc. and you want to have the PDF’s stamped/watermarked “Exhibit 1”, “Exhibit 2”, etc.

  3. Ed says:

    Is there any way to not have it prompt you with the options dialog box for every file when you have selected multiple files for it to do this to?

    I have thousands of files that need to be stamped. This is a cool action, but hardly automation if I have to intervene for every file.

    • Rick Borstein says:

      You need to change the Action Save options to not ask you.

      • Erin says:

        This is a great tool! Unfortunately, I don’t know any js, and I cannot figure out how to automate multiple files. As Ed pointed out, the options dialog box appears before each file.

        Rick, I perhaps misunderstood your response, but I do have the Action “Save To: The same folder selected at start,” but the options box appears each time. Any suggestions?

        • Rick Borstein says:

          Yes, that was how this Actions was developed. You can just hit Enter repeatedly.

  4. Steve says:

    Hello Rick – Has anyone reported any computer problems after using the new Stamp File feature in Acrobat X?

  5. Lisa says:

    Downloaded and imported with no problems.
    We use the entire file name on our documents
    What would I need to change in the js to have the “file name w/path” as one of the options?

    • Rick Borstein says:

      I wish I could support you on that, but I’m not a JavaScript person. Check out

  6. Ryan says:

    I would like to be able to save a mail merge in word as a pdf and in the process assign the name of the file from the original merge list, i.e. “Company Name”. Any ideas?? Help!!

    • Rick Borstein says:

      I don’t think that is possible using our Mail Merge feature for Word. The same file name for the PDF is sent to every recipient. has a tool that can split into PDFs from text found on document called AutoSplit. Using it, you could print the completed merge to PDF and then use the plug-in to extract the files and name them by recipient.

  7. Jake says:

    I cannot run this action on my Mac OS X Lion with Acrobat X. It freezes on the first doc every time and I have to abort. Any thoughts?

    • Rick Borstein says:

      I was able to run it on my Mac OSX Lion, so I’m not sure what the issue might be.

  8. Thendral says:

    Hi Guys Thank you very much for excellent script. Is there any way the file name without .pdf part can be included in the regular script, say as a radio button option or a check box?

    I am sorry that I am not that good in scripts.

    Thanks a lot for your help.

    • Rick Borstein says:

      You’d need to talk to the developers over at

    • Marc says:

      I also am not familiar with JS but figured it out.
      Go to the line

      var strLabel = global.FileNameStamp.strDocStamp.replace(/\n/g,”\r”);

      Then add this line below that
      var strLabel = global.FileNameStamp.strDocStamp.replace(/\.pdf$/i, “”);

      so it looks like

      var strLabel = global.FileNameStamp.strDocStamp.replace(/\n/g,”\r”);
      var strLabel = global.FileNameStamp.strDocStamp.replace(/\.pdf$/i, “”);

      Seems to be working…..
      Now if we can automate the list of pages added so all files would be stamped without having to keep hitting “Apply” or the enter key.
      An “Apply All” would be nice

  9. dan says:

    is there any way to print the whole path in addition to the filename?

    • Rick Borstein says:

      I assume you mean to add the filename of a PDF onto the document as a header or footer. Unfortunately, not out of the box.

  10. Andrew says:

    Hi Rick,

    Do you know if there’s a way I can add a “Page 1 of N” in this process?