Generate Random Number with conditions (watermark pdfs)
Requirements:
Watermark around 100 pdf file of around 100 pages each with below conditions:
1. 5 Pages to be watermarked for each file excluding Pages 1 - 5
2. All 5 pages for each file should be different .. ex- if File1 was watermarked on page nos. 11, 22, 49, 80, 95 then second file2 should be watermarked with different set of pages ex- page nos. 14, 18, 49, 90,99 and so.. on
3. Each file must close automatically without prompting to save dialog box everytime.
I am using the below script to save file but still prompting the save dialog box
var oMyDoc = this.documentFileName;
app.execMenuItem("Save", oMyDoc);
this.closeDoc(true);
I have the following script for watermarking and generating random number:
var cMyText = util.printd("mm/dd/yyyy", new Date);
var r = Math.floor(Math.random() * 100) ;
if (r > 10){var first = r; }
this.addWatermarkFromText({
cText: cMyText,
nRotation: 45,
cFont: "Helvetica-Bold",
nFontSize:20,
aColor: color.gray,
nStart: this.pageNum=first
nOpacity:0.5});
Thanks in advance
