2 Replies Latest reply on Apr 1, 2011 11:54 AM by Flying Skwerl

    Adding a watermark from App-Level script

    Flying Skwerl

      Hello all,

        I've have a folder-level script that puts a button on the toolbar.  This button calls a function that will insert watermarks and append several PDF documents to the current one.  I've hit a roadblock with this.addWatermarkFromFile(). When the function is called an error is thrown that states the following:

       

      TypeError: this.addWatermarkFromFile is not a function.

       

        Pasting a few lines from the function into the console and executing from there works… but it always bombs when executed from a function.

       

        The documentation states it requires priveleged functionality, which I provided.  My function looks like this:

       

      function generateReport() 
      {
          app.beginPriv();
          this.addWatermarkFromFile(
          {
              cDIPath:     strPathReportFront,
              nSourcePage: 0,
              nStart:      intPageReportFront, 
              nEnd:        intPageReportFront
          });
      
        //CODE CLIPPED FOR SAMPLE PURPOSE
      
        app.endPriv();
      };
      
      app.trustedFunction(generateReport);
      

       

       

      Anyone know where I'm going wrong?