Announcement

Collapse
No announcement yet.

this.flattenPages() not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • this.flattenPages() not working

    Hello,

    I have a PDF form that I need flattened before it gets submitted.

    I spoke with a Foxit chat agent who provided this javascript which was pulled from: https://answers.acrobatusers.com/fla...e-q219610.aspx

    Code:
    this.flattenPages();
    app.execMenuItem("SaveAs");
    I have that code in a 'Run a Javascript' action on a push button click but nothing appears to happen when I click on the button.

    I am using Foxit PhantomPDF ver 9.0.1.1049 Business Edition to create the PDF.
    I am filling out the form and clicking the button in Acrobat Reader DC Ver 2020.013.20064.

    Does anyone have any suggestions on why the pdf is not being flattened or some ways to troubleshoot why it's not working?

    Thanks,

    robertg
    Attached Files

  • #2
    rgentile ,I have submitted the PDF file sample you provided to our related team for further analysis with report ID#PHANTOM-15107 and ask them to modify the JavaScript in the PDF file for you. Once we get the new demo file,we will send it to you.

    Comment


    • #3
      Thank you Lisa_lee!

      Comment


      • #4
        Hello Lisa_lee, has your team been able to look at my pdf and have any recommendations for getting the flattenPages() to work?

        Thanks

        Comment


        • #5
          rgentile There is not updates for now and I have forwarded your message to our team. any updates will inform you. tks.

          Comment


          • #6
            Acrobat Reader cannot flatten pages. It's by design.

            Otherwise, your script works fine but it flatten the last page only.
            To flatten all pages you need to remove the "7" in the script (the 3rd line is useless):

            this.flattenPages(7);
            app.execMenuItem("SaveAs");
            Last edited by JRB; 11-19-2020, 02:19 PM.

            Comment


            • #7
              Thanks for the reply JRB. In my initial discussions with the Foxit chat agent I specifically mentioned I was using Acrobat Reader because I knew Reader had some limitations but I guess that part was overlooked.

              Comment


              • #8
                Originally posted by rgentile View Post
                Thanks for the reply JRB. In my initial discussions with the Foxit chat agent I specifically mentioned I was using Acrobat Reader because I knew Reader had some limitations but I guess that part was overlooked.
                I guess that Foxit Reader have the same behavior.

                Comment


                • #9
                  JRB ,The spam post has already been deleted. Regarding the issue you mentioned in this thread,I have just reminded our related team again.

                  Comment


                  • #10
                    @Lisa_lee you should remove the citation in my post too, otherwise the spam will remain ;-)

                    Comment


                    • #11
                      JRB ,I am sorry that I didn't see any spam and citation in this thread now,please let us know the user name of the user who sent the citation you mentioned ?
                      For flatten all page in PDF form file,you have to remove the the number 7 from this.flattenPages(7) in JS codes.Please refer to attached screenshot:JS codes.png.

                      Attached Files

                      Comment


                      • #12
                        I am sorry that I didn't see any spam and citation in this thread now,please let us know the user name of the user who sent the citation you mentioned ?

                        Comment


                        • #13
                          JRB ,Thanks so much for pointing out that.I have already deleted your post which contains that mentioned citation,

                          Comment

                          Working...
                          X