0 Replies Latest reply on Jun 9, 2008 3:58 PM by (Duncan_Johnston)

    Incorrect structure was found in the PDF message

      I have a folder level javascript that creates a custom menu item which when clicked inserts a page at the end of the open document.
      Sometimes when executed, a dialog box appears that says "An incorrect structure was found in the PDF file" but the page is inserted anyway.
      We work with a lot of documents that have been scanned as a PDF. However, as I said it only occurs with some documents....

      Is it just the way they have been scanned? Or is there an error in my script? Or perhaps another explanation?

      Could I suppress that particular alert since the page is inserted anyway?

      I have just checked the script with Acrobat 7.0 and although I don't get the 'Incorrect structure was found in the PDF' message the javascript debugger appears with this message in the console:'Exception in line 19 of function anonymous, script folder-level:App:InsertSummaryPage.js' but once again the page is still inserted anyway.

      Here is the javascript I am using to insert a page:

      trustedNewDoc = app.trustedFunction(function ()
      app.beginPriv(); // Explicitly raise privilege
      this.insertPages({nPage:this.numPages-1, cPath:"/C/Program Files/Adobe/Acrobat 7.0/Acrobat/Javascripts/SummaryPage.pdf"});
      app.addMenuItem({cName:"Insert Summary Page", cParent:"Tools", cExec:"trustedNewDoc()"});