I want to print the source code, Opened File-> Print.
In the print its printing the full file path on top. I want to print only the file name. How can I do this?
The Text line $FILE$ is printing the file path on top of the paper. I tried $NAME$,$FILENAME$, etc,. but not working? Any hope?

You can print the file name with $FILENAME$, Check IntelliJ IDEA documentation here.
Text line :- In this text box, specify the contents of the header or footer. If necessary, combine plain text with print keywords. By default, IntelliJ IDEA suggests to print the name of a file $FILE$ in the header and the current page number $PAGE$ of all pages $TOTALPAGES$ in the footer.
The following print keywords are recognized:
$FILE$ prints fully qualified file name.
$PAGE$
$DATE$
$TIME$
$FILENAME$ prints file name without path.
$TOTALPAGES$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With