0 Replies Latest reply on Nov 25, 2011 2:22 AM by 9825norbert

    How to trigger javascript in parent window which opens a pdf in iframe after event (didPrint)


      My main goal is the following:


      1. PHP generates PDF using fpdf <-- OK

      2. javascript: PDF opens in an IFRAME <-- OK

      3. PDF prints silently using emb java <-- OK

      4. After print, call a function in my javascript <-- Problem


      I tried window.onload() in java, but this seems to fire once the window is loaded. Means, that the pdf itself is not loaded and hence the print process has not started.


      I'm currently exploring to use setAction(didPrint, action) to create a robust trigger -


      function AutoPrint($dialog=false)


      //Open the print dialog or start printing immediately on the standard printer

      $param=($dialog ? 'true' : 'false');


          $script.="setAction('DidPrint', app.alert('test2'))";




      So, this prints and generates the alert box.


      But, I'm clueless on how to fire a command to call a function in my java script....



      Help is appreciated.