Print Page | Close Window

Push values to attachments from portfolio

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=1597
Printed Date: 18 Jul 2019 at 9:23pm
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Push values to attachments from portfolio
Posted By: bill.staub
Subject: Push values to attachments from portfolio
Date Posted: 03 Jul 2015 at 10:21am
Hi there!

I need some help regarding a JavaScript Acrobat scripting issue.

I have a PDF Portfolio (created with Acrobat), including 3 interactive PDF forms (XFA-Forms, created with Live Cycle). What I want to do is have a script on document level of the portfolios cover sheet which counts the pages of all attachments and puts the String "Page X from Y" to a XFA form field inside each attachment. This is how the script looks like right now:


if (this.collection)

    {

    var attachments = this.dataObjects;

    var doc = null;

    

    for (var a = 0; a < attachments.length; a++)

        {

        doc = this.getDataObject(attachments[a].name);

        if(doc.xfa) {

            if(doc.xfa.resolveNode("xfa.form..FUSSNOTE_PAGES")) {

               doc.xfa.resolveNode("xfa.form..FUSSNOTE_PAGES").rawValue = "Page X of Y";

            }

        }

        doc.closeDoc();

    }

}

Now what I see is that something happens and the documents are filled really with content, but in acrobat reader, only the last attachment remains with the pushed field value, the other two attachments remain without the value. How can I assure that the values will be pushed to all documents using acrobat reader (XI)? Are there any alternatives like global variables (but I cannot have a folder or app level script - only document level)..

Kind Regards, Bill






Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net