Author Topic: Stamps: Filename (without file extension)  (Read 2272 times)

0 Members and 1 Guest are viewing this topic.

nightslayer23

  • Newbie
  • *
  • Posts: 94
Stamps: Filename (without file extension)
« on: May 18, 2021, 02:30:55 AM »
What would be the code to add the filename as an option in your stamping tool but exclude the ".pdf"

RTT

  • Administrator
  • *****
  • Posts: 907
Re: Stamps: Filename (without file extension)
« Reply #1 on: May 19, 2021, 02:09:38 AM »
Add a text stamp and set it dynamic. Click the configure button and from the script type objects options add a new script and name it FilenameNoExt.
Set the script code as:
Code: [Select]
function FilenameNoExt() {
    var Filename = BatchFile.filename;
    return Filename.substring(Filename.lastIndexOf('\\') + 1, Filename.lastIndexOf('.'))
}
You can now type [<FilenameNoExt>] as the stamp text to stamp the PDF filename without the file extension.

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: Stamps: Filename (without file extension)
« Reply #2 on: June 23, 2021, 07:10:59 AM »
WOO! LEGENDARY

nightslayer23

  • Newbie
  • *
  • Posts: 94
Re: Stamps: Filename (without file extension)
« Reply #3 on: October 07, 2022, 07:53:21 AM »
How can we add more font choices to the list?

RTT

  • Administrator
  • *****
  • Posts: 907
Re: Stamps: Filename (without file extension)
« Reply #4 on: October 08, 2022, 01:42:36 AM »
That's not possible with the current version. Only the standard PDF fonts can be used.