ok, so I took bits of codes from the internet and managed to get some stuff to work but it only works on the first page and I would like that to be done on every page. I'm sure it's a noob mistake but just haven't found the answer.
The idea is that it writes the filename with a barcode font and the line after the page number, I put it in two different loops to have two different fonts (hoping that it makes sense).
for (var p = 0; p < this.pageNum; p++);
var cMyText = event.target.documentFileName.replace(/\.pdf$/i,"");
event.target.addWatermarkFromText({
cText: cMyText,
nFontSize:10,
aColor: color.black,
cFont: "LibreBarcode39Text-Regular",
nHorizAlign:app.constants.align.left,
nHorizValue: 36,
nVertAlign:app.constants.align.top,
nVertValue: -3,
nStart: p
})
for (var s=0; s<this.pageNum; s++);
var cMyText = "\nPage " + (s+1) + " of " + numPages;
event.target.addWatermarkFromText({
cText: cMyText,
nFontSize:8,
aColor: color.black,
nHorizAlign:app.constants.align.left,
nHorizValue: 36,
nVertAlign:app.constants.align.top,
nVertValue: -10,
nStart: s
})