this.insertpages causes error
I have a script that is causing an error. Everything works except one line. I am trying to insert a page in the document and the document.
The line
this.insertPages({nPage:-1, cPath:"C:\Users\xxxxx\Downloads\Documents\Blank Page PDF.PDF"});
throws an error about security settings prevent access to this method. How do I run this code in "privleged mode" It is Acrobat DC.
{
var numWords;
try
{
for (var i = 0; i < this.numPages; i++)
{
numWords = this.getPageNumWords(i);
if (numWords < 300) {
var PageText = "";
for (var j = 0; j < numWords; j++) {
var word = this.getPageNthWord(i,j,false);
PageText += word;
}
var strMatches = PageText.match("This Page Intentionally Left Blank");
if (strMatches != null) {
this.insertPages({nPage:-1, cPath:"C:\Users\xxxxx\Downloads\Documents\Blank Page PDF.PDF"});
}
}
}
}
catch(e)
{
app.alert("Processing error: "+e)
}
}
