// ----- Basic PDF Stamping script ----- \\ /* This script will place three stamps onto a PDF. The first stamp will only appear on the first page. The second stamp will appear on all pages, and will not change. The third stamp appears on all pages and displays a number that will increment. */ var myTopStamp = "Topstamp"; var myLowerStamp = "Lowerstamp"; var pageAmount = this.numPages; // Finds the length of the PDF // Stamping is achieved by using the "addWatermarkFromText" method this.addWatermarkFromText({ cText: "Single page stamp " + myLowerStamp, nStart: 0, nEnd: 0, nFontSize: 8, nTextAlign: app.constants.align.left, nHorizAlign: app.constants.align.left, nVertAlign: app.constants.align.bottom, nHorizValue: 20, nVertValue: 20 }); this.addWatermarkFromText({ cText: "Stamp with a line break" + myTopStamp + "\r" + "New line", nStart: 0, nEnd: pageAmount, // Stamp on all pages untill the end of the PDF nFontSize: 10, nTextAlign: app.constants.align.right, nHorizAlign: app.constants.align.right, nVertAlign: app.constants.align.top, nHorizValue: -20, nVertValue: -20 }); for (i = 0; i <= pageAmount; i ++) { this.addWatermarkFromText({ cText: "Dynamic stamp number: " + (i +1), nStart: i, nEnd: i, nFontSize: 10, nTextAlign: app.constants.align.right, nHorizAlign: app.constants.align.left, nVertAlign: app.constants.align.top, nHorizValue: 20, nVertValue: -20 }); }