This file is already open.
The following code works well on previous acrobat revision, but now on acrobat DC doesn't work. Please give some help tips, thanks!
doc = app.openDoc({ cPath: "/C/temp/doc1.pdf" })
// List of files of different extensions
aFiles = new Array( "doc2.jpg ", "doc3.jpg ", "doc4.pdf");
for ( var i=0; i < aFiles.length; i++) {
// Open and convert the document
newDoc = app.openDoc({
oDoc: doc,
cPath: aFiles,
bUseConv: true
})
// Save the new PDF file to a temp folder
newDoc.saveAs({ cPath: "/C/temp/tmpDoc.pdf" });
// Close it without notice
newDoc.closeDoc(true);
// Now insert that PDF file just saved to the end of the first document
doc.insertPages ({
nPage: doc.numPages-1,
cPath: "/C/temp/tmpDoc.pdf",
nStart: 0
});
}
RaiseError: This file is already open.
Doc.saveAs:12:Console undefined:Exec
===> This file is already open.
undefined
