25 Replies Latest reply on Sep 15, 2010 9:15 AM by MarkWalsh

    Waiting till a PDF has printed?

    Rob-B

      Hi, I have the following code which hides part of my document forcing the user to use my print button and run the code attached to it:

       

      var f = getField('hideTitle');

      f.textColor = color.red;

      f.value = 'Not a valid document unless printed using the Print button. This text will not display on the printed document.';

      f.alignment = "center";

      f.display =display.visible;

       

      var g = getField('hideBc');

      g.textColor = color.red;

      g.value = 'Not a valid document unless printed using the Print button. This text will not display on the printed document.';

      g.alignment = "center";

      g.display =display.visible;

       

      function Print() {

      f.display =display.hidden;

      g.display =display.hidden;

      print();

      this.getURL('www.example.com',false);

      f.display =display.visible;

      g.display =display.visible;

      }

       

      But the hidden values toggle before the document has printed so they become inconsequential. How can I wait for the print() to have finished sending to the spooler before I toggle the fields display back to on?

       

       

      Thanks,

       

      Rob