6 Replies Latest reply on Aug 24, 2008 11:15 AM by H Shonka

    reuse Javascript from one pdf to another pdf

      Hi,

      Would you teach me how I can reuse the scripts in one PDF file to
      another PDF file please?


      Thanks.
        • 1. Re: reuse Javascript from one pdf to another pdf
          George_Johnson MVP & Adobe Community Professional
          Copy & Paste? If that sounds unhelpful, you might want to provide more details. What types of scripts (e.g., field, document-level, bookmarks, links, etc.) What do the scripts do?

          George
          • 2. Re: reuse Javascript from one pdf to another pdf
            Level 1
            George_Johnson@adobeforums.com wrote:
            > Copy & Paste? If that sounds unhelpful, you might want to provide more details. What types of scripts (e.g., field, document-level, bookmarks, links, etc.) What do the scripts do?
            >
            > George


            Hi,

            I have a bunch of Document-Level Javascripts in one PDF file that I want
            to use in another PDF file.

            Sadly... Copy and Paste doesn't work...

            I have tried "Edit All Javascripts..." and then highlighted all the
            functions with the "Document" tag; and then "copy and paste" to the
            other PDF file.

            It doesn't seem to work. I have to manually add the name of the
            functions to the "Document Javascripts..." windows one by one. After
            that, then I can copy and paste the entire block of code from "Edit All
            Javascripts..." window to the new PDF file.


            Please help.

            Thanks!
            • 3. Re: reuse Javascript from one pdf to another pdf
              gkaiseril MVP & Adobe Community Professional
              Did you read the warnings at the top of the page? They mean exactly what they say.

              You could write document level JavaScripts in a PDF and save it. Then edit the PDF and delete all but one page and save under a second name. Now open the PDF you want to insert the document level JavaScripts into and insert the second save file at the end of the new PDF. Now delete the new last page and the document level from the old file will remain in the new PDF as document level JavaScripts.

              One could also use appliction folder level JavaScirpts, but they would not be in the PDF, only available for use by PDFs on you system unit.
              • 4. Re: reuse Javascript from one pdf to another pdf
                George_Johnson MVP & Adobe Community Professional
                I see. One thing you can do is simply add the pages (Document > Insert Pages) from a document (without scripts) to the document with the document-level JavaScripts, and then delete the pages that were present in the the document that originally contained the document-level JavaScripts.

                Doc1(with JS) + Doc2(without JS) - Doc1 pages = Doc2(with JS from Doc1)

                There are variations on this theme that may be more efficient, but you should get the idea. For example, you can create a single page blank PDF that contains a library of JavaScripts, and when you want to add that library to a document, simply add the library PDF to the PDF you want it added to, and delete the blank page.

                George
                • 5. Re: reuse Javascript from one pdf to another pdf
                  Level 1
                  Geo_Kaiser@adobeforums.com wrote:
                  > Did you read the warnings at the top of the page? They mean exactly what they say.
                  >
                  > You could write document level JavaScripts in a PDF and save it. Then edit the PDF and delete all but one page and save under a second name. Now open the PDF you want to insert the document level JavaScripts into and insert the second save file at the end of the new PDF. Now delete the new last page and the document level from the old file will remain in the new PDF as document level JavaScripts.
                  >
                  > One could also use appliction folder level JavaScirpts, but they would not be in the PDF, only available for use by PDFs on you system unit.


                  Hey!!! That did the trick!!! Awesome!!!

                  Thanks!!!
                  • 6. Re: reuse Javascript from one pdf to another pdf
                    H Shonka
                    tom866,

                    This reply may be a little late for you, but I would like to share an excellent solution I found on Planet PDF by Dr. D. P. Story, "Automatic Insertion of Document-Level JavaScripts"
                    http://www.planetpdf.com/developer/article.asp?ContentID=automatic_insertion_of_documen&gi d=6505

                    I thought others may find it useful too.

                    Henry