4 Replies Latest reply on Aug 5, 2016 1:56 PM by pierrem17659459

    Adding flattenable text to a PDF through Javascript

    pierrem17659459

      Dear Adobe Experts,

       

      I have been trying to add text to a PDF file through JavaScript for the past 4 hours. I have gotten the hang of multiple Adobe JavaScript guides. I have looked thorough fully but cannot solve this problem: adding a text box/text to a PDF page using JavaScript and then being able to flatten it successfully.

       

      I have been using the addField with text as an option but when flattened the text box disappears. I will try to mess around with the button option and try to flatten it but I am weary of possible bugs

       

      Here is my code:

      var f = this.addField("info", "text", 0, [5,5, 250,25]);
      f.delay = true;
      f.alignment = "center";
      f.fillColor = color.white;
      f.lineWidth = 1;
      f.strokeColor = color.red;
      f.borderStyle = style.s;
      f.textSize = 24;
      f.textColor = color.black;
      f.textFont = font.Arial;
      f.defaultValue = "Receive Stamp";
      f.editable = false;
      f.multiline = false;
      f.doNotScroll = true;
      f.delay = false;
      

       

      Any help would be appreciated,

      Good day