Copy link to clipboard
Copied
I use this code and it worked , I need to add the "Windows Login ID" with the print as " This document was printed on dd/mm/yyyy by User Name" Can you help in this to modify the code.
var inch = 54;
for (var p = 0; p < this.numPages; p++) {
var aRect = this.getPageBox( {nPage: p} );
aRect[1] = .5*inch;
aRect[3] = aRect[1] - 24; // and 24 points high
var f = this.addField("PrintField", "text", p, aRect )
}
var myWillPrintScript = 'var f = this.getField("PrintField"); \r'
+ 'f.value = "Printed on " + util.printd("dd/mm/yyyy hh:MM tt", new Date()); \r';
Copy link to clipboard
Copied
I use this code and it worked , I need to add the "Windows Login ID" with the print as " This document was printed on dd/mm/yyyy by User Name" Can you help in this to modify the code.
var inch = 54;
for (var p = 0; p < this.numPages; p++) {
var aRect = this.getPageBox( {nPage: p} );
aRect[1] = .5*inch;
aRect[3] = aRect[1] - 24; // and 24 points high
var f = this.addField("PrintField", "text", p, aRect )
}
var myWillPrintScript = 'var f = this.getField("PrintField"); \r'
+ 'f.value = "Printed on " + util.printd("dd/mm/yyyy hh:MM tt", new Date()); \r';
Copy link to clipboard
Copied
[I moved your question from the Forum Comments forum to the JavaScript forum. Why did you post it there?]
First of all, an inch is 72 points, not 54.
You can access the login-name via the identity object, but it requires a privileged context, ie you will need to install a script on the user's local machine to do it.