Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments

File name code


Not applicable
Does anyone have JS code that will add the current file name (or complete path) to that document.
3 Replies


Not applicable
I would like to embed the file name and/or path into the footer of the pdf. Much like Word can do in the header and footer of the document.


Level 9
Try this on the click event of a button in javascript:

var myDoc =;'The file name of this document is ' + myDoc.documentFileName + '\nThe path name of this document is ' + myDoc.path);