19 Replies Latest reply on Dec 7, 2011 4:39 AM by Harbs.

    Setting Flattener preferences when exporting PDF


      Hi everyone,


      I'm trying to define a preset when exporting to PDF to make sure that layers transparency works properly independantly from what are the current presets in inDesign.


      var app:Application = InDesign.app;

      app.pdfExportPreferences.exportLayers = false; // Setting some other export preferences, no problem here


      var flattenerPreset:FlattenerPreset = app.flattenerPresets.add();

      flattenerPreset.name = "MyCustomPreset";

      flattenerPreset.rasterVectorBalance = FlattenerLevel.LOW;


      flattenerPreset.convertAllTextToOutlines = true;


      app.pdfExportPreferences.appliedFlattenerPreset = flattenerPreset; // Crashes


      Unfortunately this doesn't work and I get a mysterious error on the last line:


      Error: The property is not applicable in the current state.

                at flash.external::HostObject/__set()

                at com.adobe.csawlib::CSHostObject/hostSet()


      Any idea what I'm doing wrong?

      Thanks in advance for your help.