I have a web based application the opens PDF files and adds a watermark and then saves the file to a new location. The watermark is added with a javascript function that has worked until IE11 was installed on my laptop which is running Windows7. The error happens at this point in the code;
if (jso = doc.GetJSObject()) {
tracker=4;//4
This is the code leading up to the to point where the error occurs;
function createActiveXObjects(){
if(!fs) fs = new ActiveXObject("Scripting.FileSystemObject");
if(!app) app = new ActiveXObject("AcroExch.App");
if(!doc) doc = new ActiveXObject("AcroExch.PDDoc");
function addUncontrolledCopy(files){
try{
//Create the objects needed to manipulate pdfs
var tracker=0;var k=0;
var file,source,destination,c=0;
//Check if the ActiveX objects are created;
tracker=1;//1
//alert(files);
if (doc && fs && app){
//Try to open the file
var folder=PROCESSPRINTS;
//alert(folder);
//Check if the folder exists, if not create one;
folder+=partNumber.substr(0,4)+" Prints\\";
if (!fs.FolderExists(folder)){fs.CreateFolder(folder);}
tracker=2;//2
if(!fs.FolderExists(folder+=partNumber+"\\")){fs.CreateFolder(folder);}
tracker=3;//3
for (k=0;k<files.length;k++){
//Get the default location of the pdf files
if (doc.open(file)){
//get jso object from file
if (jso = doc.GetJSObject()) {
tracker=4;//4
//Add the "Uncontrolled Copy" and save the file;
tracker=5;//5
//Move the pdf files to the new location;
//alert(source);
//alert(destination);
tracker=-1;//-1
tracker=6;//6
//Keep track on how many files are moved;
//Kill TIF files
file=TIFUPDATES+files[k].replace(/.pdf/i,'.tif');
if(fs.FileExists(file)) fs.DeleteFile(file);
tracker=7;//7
}//else alert("Failed to open "+pdfFile);
//Display a notification of how many files were moved;
if (c>0) alert("There were "+c+" prints distributed.");
Does anyone have any ideas on what might be causing the problem or how to resolve the issue?