Skip to main content
Known Participant
February 18, 2019
Answered

How insert file name in PDF document. Batch process.

  • February 18, 2019
  • 1 reply
  • 4957 views

I have 200+ documents. I need to paste (insert) on the page (no matter where, but preferably in the upper right corner) the document file name. How can I do that?

Thank you.

This topic has been closed for replies.
Correct answer try67

Create an Action that executes this JavaScript code and then saves the file:

this.addWatermarkFromText({

    cText: this.documentFileName,

    nTextAlign: app.constants.align.right,

    nHorizAlign: app.constants.align.right,

    nVertAlign: app.constants.align.top,

    nHorizValue: -72, nVertValue: -72

});

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 18, 2019

Create an Action that executes this JavaScript code and then saves the file:

this.addWatermarkFromText({

    cText: this.documentFileName,

    nTextAlign: app.constants.align.right,

    nHorizAlign: app.constants.align.right,

    nVertAlign: app.constants.align.top,

    nHorizValue: -72, nVertValue: -72

});

Known Participant
February 18, 2019

Thank you, it works. How to change the location of the file name, I understood. Is it possible to choose the font size?

Thanks again

Legend
February 18, 2019

This is the documentation you need for the doc.addWaterMarkFromText method

Acrobat DC SDK Documentation