3 Replies Latest reply on Sep 7, 2012 1:54 PM by gkaiseril

    Dynamically include document level javascript

    CJR329

      I am looking for a way to dynamically include a common piece of Javascript into our PDF templates, of which we have hundreds.

       

      The script I need to add to our templates (sometimes) provides a listener that allows a containing HTML page to post a simple string message (like 'Submit') that tells the PDF to submit itself.

       

      I do not want to permanently add the document-level script with by copy/pasting or some automated/batch technique.  I only want to add this document level script when the PDF is embedded in a container such as an HTML page.

       

      I have seen the technique of adding folder-level .js files which would appeared as a solution at first, except that it would be adding the script when not needed in some cases, and the folder-level technique appears to be appropriate only for the app level context, so it will not provide a solution to my requirement anyway, which is at the doc level.

       

      We use AP Toolkit on the server side to generate the PDFs but I do not see a way to accomplish what I need to do with that, either.

       

      I have researched heavily to find a solution and have come up empty. Is there a solution to this problem?

       

      Thanks.