3 Replies Latest reply on Oct 1, 2013 12:06 PM by njohnsrud

    Need help flattening only some pages of document

    njohnsrud

      So here is what I'm trying to do...

       

      I have a 3 page pdf form that is set to run a javascript when you complete the form and click a submit button. The java I have written is:

       

      if (this.getField("Item Needing ActionRow1").value=="No punchlist items found")

           this.submitForm({cURL: "mailto:email@domain.com?subject=Completed FAT: " + this.getField("Project Number").value, cSubmitAs: "PDF"});

      else

           this.submitForm({cURL: "mailto:email@domain.com?subject=Completed FAT - Contains Punchlist Items: " + this.getField("Project Number").value, cSubmitAs: "PDF"});

       

      When the user clicks the button I would like the form to flatten pages 1 & 2, but not page 3. I know the script this.flattenPages(); will flatten all of the pages, but I thought you could only flatten specific pages. I got to this link http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/common/html/w whelp.htm?context=Acrobat9_HTMLHelp&file=JS_API_AcroJS.88.466.html but I don't really understand if that is what I need or not.

       

      This script does what I want, except again, it is all of the pages that are flattened.

       

      if (this.getField("Item Needing ActionRow1").value=="No punchlist items found")

           this.submitForm({cURL: "mailto:email@domain.com?subject=Completed FAT: " + this.getField("Project Number").value, cSubmitAs: "PDF" + this.flattenPages();});

      else

           this.submitForm({cURL: "mailto:email@domain.com?subject=Completed FAT - Contains Punchlist Items: " + this.getField("Project Number").value, cSubmitAs: "PDF" + this.flattenPages();});

       

      Any thoughts?

       

      Appreciate the help!