3 Replies Latest reply on Jun 25, 2010 3:34 PM by [Jongware]

    How to force an autoflow

    stimms-enform

      In CS4 I am importing an XML file and then exporting a PDF from it.  So I have some code which looks like

       

      currentDocument.importXML('file.xml');
      currentDocument.exportFile (ExportFormat.pdfType, File('file.pdf'), false);

       

      I had rather expected that the import would complete before returning but that doesn't seem to be the case so the export only exports the first page.  Once the script is complete then autoflow runs and fills out the rest of the pages.  Is there some way to trigger an autoflow between the two lines?  I tried just sleeping but apparently that is a locking operation so nothing else runs during the sleep.  I also looked for an event which might be fired after the import had really finished but the afterImport event looks like it fires to early for my needs.