I thought as much. The reason why I code in Workflow using VBScript instead of JavaScript is because I always get headaches using JavaScript. That and the fact that Workflow and Designer use different versions of ECMAScript. (I think 5 for Workflow and 6 for Designer)
I’m sure one of the OL devs will respond here too.
can confirm that as well, it seems the script cannot release the pdf page object, may be a bug with the Workflow js interface.
Best you open a ticket with your local OL Support team.
I think this is a JavaScript Garbage Collection issue where some page objects are not immediately released after you null them. You could probably workaround it by forcing Garbage collection before closing the PDF with CollectGarbage()
var PDF1 = Watch.GetPDFEditObject();
PDF1.Open(Watch.GetJobFileName(),false);
var oPages = PDF1.Pages();
var nPagesNumber = oPages.Count();
var nNumberOfElements = nPagesNumber/4;
var nCurrentElement = 0;
while( nCurrentElement < nNumberOfElements){
var sCustomerNumber = oPages.Item(nCurrentElement*3).ExtractText2(2.0, 0.6, 4.0, 0.86);
++nCurrentElement;
}
oPages = null;
PDF1.Save(false);
CollectGarbage();
PDF1.Close();
Alternatively, you could also catch the error and just simply carry on:
var PDF1 = Watch.GetPDFEditObject();
PDF1.Open(Watch.GetJobFileName(),false);
var oPages = PDF1.Pages();
var nPagesNumber = oPages.Count();
var nNumberOfElements = nPagesNumber/4;
var nCurrentElement = 0;
while( nCurrentElement < nNumberOfElements){