9 Replies Latest reply on Jan 19, 2013 3:16 PM by George_Johnson

    NotAllowedError: Security settings for template.spawn()

    Harliquinn

      I'm creating a PDF document that heavily uses the template.spawn() method. My understanding is that the spawn() method is allowed whenever the PDF document is given "Reader Rights" in Acrobat. I am using Acrobat X (and Acrobat Forms, not LiveCycle) and have saved my PDF with Reader Extended Rights. When I load the file in Reader 11 and click the button that spawns pages, I get the javascript error: NotAllowedError: Security settings prevent access to this property or method. Am I doing something wrong or have I misunderstood the notation in the Adobe API that says .spawn() is allowed with Reader Form Rights?

       

      Thanks,

      John

        • 1. Re: NotAllowedError: Security settings for template.spawn()
          Test Screen Name Most Valuable Participant

          There isn't just one set of Reader rights, but several. Acrobat can grant some of these, others need LiveCycle Reader Extensions. It seems that this one requires "forms rights". Unfortunately I don't have a quick reference to what products (and which interfaces in them) grant which rights. Can anyone post such a guide?

          • 2. Re: NotAllowedError: Security settings for template.spawn()
            Harliquinn Level 1

            The strange thing is that if I just save the PDF from Acrobat 10 normally (no special rights) and open it in Reader 11, the template.spawn() method works fine. It only seems to give the Security Error when I save the file with Reader Rights (from Acrobat).

             

            Also, with or without Reader Rights, the exportAsXFDF() doesn't seem to work.

             

            Perhaps I'm misreading what an "F" means in the Adobe documentation. I thought "Forms Rights" was what you gave when you did a Save As PDF with Reader Extended PDF and "Enable Additional Features'.

             

            John

            • 3. Re: NotAllowedError: Security settings for template.spawn()
              DimitriM Level 3

              Hi John,

               

              All the changes from version to version sure make things confusing.  When Adobe Reader XI was released it came with some new features that DO NOT require Rights and those include the ability to Spawn Templates as well as Fill and Save data in PDF forms ( not LiveCycle though, just to add more confusion).  So first, you don't need to add Rights to your PDF at all unless you require some other Right that is not availalbe free in Adobe Reader XI.  Given that, ALL of your users will need to use Adobe Reader XI or Acrobat since earlier versions of Reader do not include the Spawn Templates without Rights.  And, if you want Spawn Templates to work in an earlier version of Adobe Reader, that is one of those that required the expensive LiveCycle Reader Extension server product, not one built into Acrobat.

               

              When you do apply rights to a PDF those Rights block all functionality not explicitly granted by the Right.  Since Spawn is there already your applying Rights negates it- kinda wierd but pretty sure that's why you get the error.

               

              The Spawn Templates is such a great new addition to Reader though, isn't it?

               

              Hope this helps,

               

              Dimitri

              WindJack Solutions

              www.pdfscripting.com

              www.windjack.com

              • 4. Re: NotAllowedError: Security settings for template.spawn()
                try67 MVP & Adobe Community Professional

                The documentation is pretty bad on this point. You were right to assume

                that, but it's not the case.

                Reader 11 is the first version of using the spawn method without the

                special form rights applied by LC Reader Extensions, so it's odd to hear

                that when you apply the Reader Rights in Acrobat that's no longer the

                case... Could be some kind of bug.

                • 5. Re: NotAllowedError: Security settings for template.spawn()
                  George_Johnson MVP & Adobe Community Professional

                  It's not a bug. As Dimitri mentioned, when you Reader-enable with Acrobat it includes certain usage rights, but template spawning is never one of them. If a document has any rights applied at all, the lack of a particular right means that the corresponding functionality is not available in Reader.

                  • 6. Re: NotAllowedError: Security settings for template.spawn()
                    George_Johnson MVP & Adobe Community Professional

                    Also, just to clarify the JavaScript documentation, the particular usage right that controls template spawning is the SpawnTemplate right, oddly enough, which is just one of several possible "Form" rights listed in the spec.

                    • 7. Re: NotAllowedError: Security settings for template.spawn()
                      George_Johnson MVP & Adobe Community Professional

                      TSN,

                       

                      After all these years, this recent blog post is about the best I've found: http://blogs.datalogics.com/author/charlesmyers4/

                       

                      On a related note, Datalogics now offers a service of Reader-enabling documents and can include more usage rights than Acrobat without the customer needing to purchase the full LiveCycle Reader Extensions software and setting up a server, just like FormRouter used to offer.

                      • 8. Re: NotAllowedError: Security settings for template.spawn()
                        Harliquinn Level 1

                        Templates are a great feature and critical to my project. It's good to know that it is by deign they can be used without special rights. However, I'll just have to restrict the usage to Reader 11. It is very confusing that adding Reader Rights removes other rights :(

                         

                        Thanks everyone for the help.

                         

                        I assume that exportXFDF is not allowed in Reader in any fashion?

                         

                        John

                        • 9. Re: NotAllowedError: Security settings for template.spawn()
                          George_Johnson MVP & Adobe Community Professional

                          Only if you use LiveCycle Reader Extensions to apply the Form - Export usage right, but you can still submit as XFDF.