2 Replies Latest reply: Jul 5, 2012 6:38 PM by Bivalvinore504 RSS

    prePrint event scope affects all other print events?


      A PDF requirement is to have one document print in different versions for different recipients -- e.g., court, DA, public defender ..

      They aren't all allowed to see the same data on people in the system, and in one instance, the form must be secured as read only.

      Sure, there are a few different ways to do this, but the workflow chosen was to complete a PDF form, and then intercept the print or email functions to hide and secure pages.

      The people who fill out the form need the entire document.

      My approach was to offer a standard print button from the tool palette. No problem.

      Then I added another print button from the tool palette, and set the pre-print and post-print events to intercept and change the number of pages output (leaving out pp 4-6). Works fine.

      form1.page1.btnPrintLimited::prePrint - (JavaScript, client)

          TextField1.rawValue = "Secure prePrint";
          page4.presence = "hidden";
          page5.presence = "hidden";
          page6.presence = "hidden";

      Then, returning to the standard print button, it seems that now all jobs are rendered with the same pages missing as were defined in the pre-print and post-print events for the OTHER button.

      What gives? I thought that the scope for control events would be limited  to those events themselves.

      I even tried in the pre-print and click events for the standard report to force the visibility of pages suppressed in the events, e.g.,

      form1.page1.btnPrintNormal::click - (JavaScript, client)

          page4.presence = "visible";
          page5.presence = "visible";
          page6.presence = "visible";
      xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);

      Is my approach a faulty one? Should I be trying something else?


      I'm using LC Designer ES2.


      Would appreciate any guidance.


      Kind regards,