5 Replies Latest reply on Nov 19, 2015 12:50 AM by try67

    Acrobat XI - Watermark Javascript Causes Font to be Embedded Multiple Times

    cenu

      Hi folks,

       

      I have a sequence in in Acrobat that watermarks each page with the file name and page number. It worked great in Acrobat X. The problem is in Acrobat XI the Javascript causes the font to be embedded once per page, rather than once for the entire document. This causes the file size to become bloated very quickly. For example: I have a 31 page PDF that is 170 KB, after the script runs in Acrobat XI the file size is 10.6 MB. After running the same code in Acrobat X the file is only 770 KB.

       

      The code is listed below. Any ideas on how to prevent this from embedding the font so many times?

       

      //Apply Watermark - Bottom Right
      for(var p=0;p<this.numPages; p++)
      {
      var FileNM = this.documentFileName.replace(/\.pdf$/i,"");
      this.addWatermarkFromText(
      {cText: FileNM + "-" + util.printf("%03d",(p+1)),
      nTextAlign: app.constants.align.right,
      nHorizAlign: app.constants.align.right,
      nVertAlign: app.constants.align.bottom,
      nFontSize: 14,
      cFont:"Helvetica-Bold",
      nHorizValue: -10,
      nVertValue: 5,
      nStart: p
      })
      }
      

       

      Please let me know if you need any additional information from me. Thank you in advance for your help!