0 Replies Latest reply on Apr 19, 2010 5:54 AM by Alex OUDIN

    [CS4 - CORBA] Howto preflight a document

    Alex OUDIN

      Hello,

       

      I have a problem with the Preflight function of InDesign Server CS4. It's very hard to use it as there's no sample script for it.

       

      1/ I want to preflight a single document. The "setPreflightScope(VariableType property)" on PreflightOption seems to be the correct method (the documentation says : "The pages or documents to preflight ...").

       

      I don't know how to pass a document or a list of documents to his method. I tried :

       

      // "application" contains the IDS Application
      // "document" contains the IDS document
      
      application.getPreflightOptions().setPreflightScope(VariableTypeUtils.createObject(document));
      

       

      What is the good method to do this ?

       

      2/ I have tried another method. I forced the use of embedded preflight  profiles in documents like this :

       

      // "application" contains the IDS Application
      // "document" contains the IDS document
      
      application.getPreflightOptions().setPreflightProfilePolicy(kPreflightProfileOptionsUseEmbeddedProfile.value);
      
      //add a preflight process one per document / profile
      PreflightProfile[] aoPreflightProfile = document.getAllChildPreflightProfiles();
      for (PreflightProfile oPreflightProfile : aoPreflightProfile)
      {
          oApplication.getPreflightOptions().setPreflightWorkingProfile(VariableTypeUtils.createObject(oPreflightProfile));
          oApplication.addPreflightProcess(document, oPreflightProfile, OptArg.noPreflightOption());
      }
      
      // parse each preflight process
      PreflightProcess[] aoProcess = application.getAllChildPreflightProcesss();for (PreflightProcess oProcess : aoProcess)
      {
          oProcess.waitForProcess(OptArg.noDouble());
          if (oProcess.getAggregatedResults().discriminator() == TypeSpecifier.kList)
          {
              VariableType[] aoAggregatedResultInfo = oProcess.getAggregatedResults().asList();
              // ... here we process the AggregatedResults
          }
      }
      

       

      This almost works, but when I load 2 documents on the server, one with an embedded profile, the other one without an embedded profile, the server process crashes.

       

      This is clearly I bug, but I don't know how to report it.

       

      As someone found another solution or a workaround for this ?