17 Replies Latest reply on Jun 4, 2014 1:53 AM by Test Screen Name

    Classic 'Flatten PDF' question

    tapehiss Level 1

      So I have created a fairly complex fillable form in Acrobat Pro (10.1.8)... I have saved it for use by other users in Adobe Reader. (File>Save As>Reader Extended PDF>Enable Additional Features...)


      The users can open file in Adobe Reader just fine, all formulas work, all values display correctly, life is grand.


      Now all I want is for the user to save a 'flattened' version of the pdf to their machine, either to print or email at a later date. If the user saves the document from Reader all fields can still be edited on next use. If I use a "lock all field" button like this:


      for (var i=0; i<this.numFields; i++) {

          var f = this.getField(this.getNthFieldName(i));

          if (f!=null && f.type!="button")

              f.readonly = true;




      When I open the saved, field locked document, I lose all the formatting in my fields. (ie. no $ symbols, or commas in numbers, etc. )


      And of course, there is no "print to pdf" option when you try and go that route... which of course, would make life too easy, wouldn't it?


      So. Does anyone have a solution for what I can only imagine is a fairly common problem? I've searched high and low to no avail.

        • 1. Re: Classic 'Flatten PDF' question
          George_Johnson MVP & Adobe Community Professional

          Setting fields to read-only should not affect the formatting at all, so something else is going on. It's hard to say what without seeing a document that behaves this way. Can you post one somewhere?

          • 2. Re: Classic 'Flatten PDF' question
            tapehiss Level 1

            Sure thing...


            Here it is: https://workspaces.acrobat.com/?d=ig-03qjnZxyPk65xKiD7oA


            When the form is locked, then saved, and then opened by another user in Mac's Preview, for example, or some other non-Adobe viewer, the $ symbol is missing.. and all field formatting in general is out the window. In a larger document with a number of dollar figures shown, this is a pretty big issue.



            • 3. Re: Classic 'Flatten PDF' question
              George_Johnson MVP & Adobe Community Professional

              The document doesn't seem to be shared properly so I can't access it. However, since you mentioned Preview, that is likely the cause. It corrupts PDF forms in a number of ways, one of which is removing all JavaScript from a PDF. Since JavaScript is used to control all formatting, there's nothing Acrobat/Reader/anything else can do to restore it. The fix is to convince all of your users to use Adobe Reader (or Acrobat) so that the forms do not get corrupted.


              One thing that may work for the final recipient of the form (depending on how the form is set up) is to export the form data with Acrobat (e.g., to FDF) and reimport it into a blank form that has not been corrupted.

              • 4. Re: Classic 'Flatten PDF' question
                tapehiss Level 1

                I see. So I'm celar then, there's no way to 'flatten' the document; removing all scripts, and leaving just the values as they appear on screen?


                I know I can achieve this desired effect if I add a signature field, and then in Reader, click on the signature field, and select lock after signing... only problem there is I have documents that require multiple signatures, and others that don't require any! So I'm foiled yet again. 

                • 5. Re: Classic 'Flatten PDF' question
                  gkaiseril MVP & Adobe Community Professional

                  With the signature field, you can specify what fields are locked or not locked, so it is possible to support multiple signatures but only the last will certify that the form has not changed. Signing a PDF invalidates the previous signature so each signer is attesting that he/she received the form with a valid signature field.

                  • 6. Re: Classic 'Flatten PDF' question
                    George_Johnson MVP & Adobe Community Professional

                    It's possible to flatten (some) forms with Acrobat, but not Reader, and not if the document is signed. Since a Reader-enabled form is signed in the process of enabling it, it can't be flattened either. When I use the term flatten here, I'm talking about converting the form field appearances to regular page contents, removing the form fields in the process. This is different than setting fields to read-only, which prevents a user from interacting with them. Using flatten to refer to setting fields to read-only is a misuse of the term.


                    Your problem doesn't seem to be related to setting fields to read-only, but rather the fact that non-Adobe PDF viewers are being used and corrupting the document. So you wouldn't be foiled if everyone were to use Adobe Reader or Acrobat.

                    • 7. Re: Classic 'Flatten PDF' question

                      So what I am understanding here is that anyone can alter an interactive form. Seems like Adobe should have thought of this and made a way to save a flattened version.

                      • 8. Re: Classic 'Flatten PDF' question
                        try67 MVP & Adobe Community Professional

                        They did. You can flatten a form with Acrobat and even apply a security policy for extra protection.

                        • 9. Re: Classic 'Flatten PDF' question
                          Test Screen Name Most Valuable Participant

                          Or signing. People become very focussed on protecting from changing but this is no protection at all against the motivated with something to gain; they only have to save a copy before filling. Also, if a fake form is worth having, they can make a complete new fake. Only digital signatures offer real protection. The file can perhaps be changed, but who cares because it's easy to see it was changed AFTER signing. (Don't think of digital signatures as a scribble on the page, they are much more subtle than that).

                          • 10. Re: Classic 'Flatten PDF' question
                            RichIdaho Level 1

                            Gilad D;

                            Thank you for your answer. But how do I flatten the form?

                            • 11. Re: Classic 'Flatten PDF' question
                              try67 MVP & Adobe Community Professional

                              You can use this (free) tool for that: UVSAR : Selective Flattener tool for Adobe Acrobat 8, 9 and X


                              And yes, signing the document is also a good way of doing it...

                              • 12. Re: Classic 'Flatten PDF' question
                                RichIdaho Level 1

                                I think I am now realizing the problem here. I wasn't real clear on the difference between Reader and Acrobat. I have always referred to them a Adobe Acrobat Pro and Adobe Acrobat Reader. I realize now that the term "Acrobat" refers to what I called Pro and Reader is actually Adobe Reader, not Acrobat Reader.

                                So my question (or concern) is still, "Why did Adobe design a method of creating a file that could be changed by anyone along the line?" If I create an interactive form, send it to a client, he fills it out and sends it to someone else, they can change the data in the form. Not a very secure system if you ask me. Seems like there should be a way for the person filling out the form to "flatten" it so no one else can change the data.

                                You mentioned something about a signature. I am not familiar with this function. If you can explain that quickly to me I would appreciate it. If not I will spend some time to figure it out. Although I find the help files in Acrobat very NON intuitive.

                                • 13. Re: Classic 'Flatten PDF' question
                                  try67 MVP & Adobe Community Professional

                                  As I said, you can set the fields as read-only and it will not be easy (although not impossible) to edit them in Reader.

                                  A digital signature field can be added to the file in Acrobat (although new versions of Reader have that built-in under the Sign panel, so it can be done even without a field), and when that field is signed by the user another user will not be able to edit the file in any way, or the signature will get invalidated. This is how you can ensure that a filled-in file is not altered. This is much better than flattening the file, by the way, since someone with Acrobat will be able to easily edit even a flattened file, but not a signed file.

                                  • 14. Re: Classic 'Flatten PDF' question
                                    Bernd Alheit Adobe Community Professional & MVP

                                    Users can submit the data to a web server. No reason to flatten the form.

                                    • 15. Re: Classic 'Flatten PDF' question
                                      RichIdaho Level 1

                                      Gilad D; Part of what I want to accomplish here is to be able to put the form on Google Drive. But when I do the interactive field are gone.

                                      Bernd Alheit; I have no idea what a "web server" is. And you say there is "no reason to flatten the form". As I just explained to Gilad D, that is just one reason to flatten the form. And I can come up with several others if you need me to.

                                      • 16. Re: Classic 'Flatten PDF' question
                                        try67 MVP & Adobe Community Professional

                                        Are you just uploading the file to Google Drive? That should not cause it to lose the interactive fields... If it does, you should report this to Google as a bug, but I have done this many times in the past and it always worked fine. Are you maybe trying to convert it to a Google Drive Form?


                                        And there are indeed plenty of reasons why one would want to flatten a PDF file... For example, for archival purposes on the user's end.

                                        • 17. Re: Classic 'Flatten PDF' question
                                          Test Screen Name Most Valuable Participant

                                          There are indeed many excellent reasons to flatten a form. But security/protection is not one of them, because it doesn't do that.