0
我在写一些JavaScript来更新文本文件的pdf字段。最后让它工作。但现在我发现我无法更新该文本文件,直到我关闭所有的PDF表单。我收到错误消息:“进程无法访问该文件,因为它正在被另一个进程使用。”我正在使用的代码:如何使用javascipt访问文件后发布文件(adobe)
//Grab the current path and update it to indicate the TempInfo location
var strPath = this.path;
strPath = strPath.slice(0,-12);
strPath = strPath + "TempInfo.txt"
//Get data from TempFile into array, display message if no file found
try{
var dataStream = util.readFileIntoStream(strPath);
var dataFrom = util.stringFromStream(dataStream);
}catch(e){
app.alert("Temp file not found");
}
//Put the data into an array and update the field
var strTest = new Array();
strTest = dataFrom.split(/\n/);
getField("Username").value = strTest[0];
在使用“util”命令后有没有办法释放文件?
那么,这是一个简单的修复,谢谢。 –