3 Replies Latest reply on Mar 11, 2008 10:05 AM by gkaiseril

    app.openDoc error in browser

      I have created a javascript that I use to add links to a pdf that opens another pdf file. The script works fine in Acrobat and Reader, but not when the pdf is displayed through a web site using Internet Explorer. I set the disclosed attribute and have gone over the reference and forums. I attached the code, below. Does anybody have any ideas? Thank you.

      app.addMenuItem( { cName: "LinkBatch",
      cUser: "Process Multiple Links ...",
      cParent: "Document",
      cEnable: "event.rc = (event.target != null);",
      cExec: "LinkBatch();" });

      function LinkBatch()
      {
      console.show();
      app.trustedFunction(UpdLinks("12", "a3.cl.1_fac_7.pdf", this));
      }

      function UpdLinks(lnam, lloc, doc)
      {
      app.beginPriv();
      try
      {
      console.println("processing " + lnam);
      doc.removeField(lnam);
      for (var p = 0; p < doc.numPages; p++)
      {
      var numWords = doc.getPageNumWords(p);
      for (var i=0; i<numWords; i++)
      {
      var ckWord = doc.getPageNthWord(p, i, true);
      if (ckWord == lnam)
      {
      var q = doc.getPageNthWordQuads(p, i);
      m = (new Matrix2D).fromRotated(doc,p);
      mInv = m.invert()
      r = mInv.transform(q)
      r=r.toString()
      r = r.split(",");
      l = doc.addLink(p, [r[4], r[5], r[2], r[3]]);
      l.borderColor = color.blue
      l.borderWidth = 1
      l.setAction("app.openDoc('" + lloc + "')", doc);
      }
      }
      }
      }
      catch (e) { app.alert(e) };
      app.endPriv();
      };