🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
9 messages
9 total messages Started by Rasmus_Olsen Tue, 10 Feb 2009 15:29
[CS3 JS] A little help setting flattener prefs
#1457
Author: Rasmus_Olsen
Date: Tue, 10 Feb 2009 15:29
8 lines
962 bytes
Ladies and gentlemen,

A little help setting flattener preferences when exporting is needed. I can't seem to grasp why I can use with(app.colorSettings){ to set the properties of the ColorSetting object but with(app.flattenerPreferences){ ESTK gives me "Object does not support the property or method.."

I'm requesting a little kick in the right direction, thanks :-)

Best regards,
Rasmus
Re: [CS3 JS] A little help setting flattener prefs
#1471
Author: Thomas_Bolbro_Nielsen
Date: Tue, 10 Feb 2009 22:33
19 lines
1343 bytes
Hi Rasmsus / Hej Rasmus

with(app.flattenerPresets) {
  alert(item(0).name);
}

This will alert the name of the first flattenerPreset.
app.flattenerPresets holds the defined presets and is read only.

The properties you can set, is listed here: <http://www.indesignscriptingreference.com/CS3/JavaScript/FlattenerPreset.htm>

So:
with(app.flattenerPresets) {
	item(0).rasterVectorBalance = 100;
}

Should set the rasterVectorBalance to 100 for the first flattenerPreset (If the first preset is a Adobe preset [low resolution] you can only change it with scripting it seems)

Hope this helps (DK: Du er velkommen til at sende mig en mail p� mail (at) nobrainer (dot) dk hvis du har brug for hj�lp til andet.
Re: [CS3 JS] A little help setting flattener prefs
#1481
Author: Rasmus_Olsen
Date: Wed, 11 Feb 2009 09:08
11 lines
1975 bytes
Hi Thomas,

Thank you for taking time to help me with this :-)

Setting the properties of the app.flattenerPresets.item(0) object does just that; you changes the properties of the "[Low Resolution]" flattener preset. What I need to know is: How do I instruct InDesign to use "x" flattener preset or flattener preferences when exporting a PDF?

In addition to this: When scanning through the InDesign object model viewer I can't help noticing the FlattenerPreference object. In my export script I set various properties of the ColorSetting object with(app.colorSettings){ - trying the same approach with(app.flattenerPreferences){ gives me the exception: "Object does not support the property or method FlattenerPreference" - so how do I set the properties of this object?

I hope that you understand my question(s) :-)

BTW I test the flattener preferences in effect upon export by using a filled frame with the Bevel and Emboss effect applied. The effect will get rasterized by the flattener when exporting a PDF version 1.3 from the document. Using Acrobat preflight on the resulting PDF I'm able to scan for image resolution and check whether or not the specific flattener property 'lineArtAndTextResolution = 300' was honoured. So far InDesign have been using 'lineArtAndTextResolution = 150' - this is a property of the Medium Resolution flattener preset. Sigh..
Re: [CS3 JS] A little help setting flattener prefs
#1487
Author: Bal�zs_Slemmer
Date: Wed, 11 Feb 2009 10:10
13 lines
1253 bytes
Hi!

First, the reason why you cannot use with(app.flattenerPreferences) is just as the exception says: app doesn't have flattenerPreferences property... only spreads have such...
So I think the way you should go:

-create either manually or by script a flattenerPreset (app.flattenerPresets) and set the lineArtAndTextResolution to a value you need

-then create a PDFExportPreset (app.pdfExportPresets) where you set its appliedFlattenerPreset property to the desired preset

-then use document.exportFile(format, to, showingOptions, using) where you set the using parameter to the previously created PDFExportPreset.

Hope it helped!
Bal�zs
Re: [CS3 JS] A little help setting flattener prefs
#1485
Author: Rasmus_Olsen
Date: Wed, 11 Feb 2009 10:35
11 lines
720 bytes
Hi Bal�zs,

      appliedFlattenerPreset




This must be it! ;-) Will give it a shot - thanks man..

Regards,
Rasmus
Re: [CS3 JS] A little help setting flattener prefs
#1381
Author: Rasmus_Olsen
Date: Thu, 12 Feb 2009 14:11
46 lines
2493 bytes
Referring to a flattener preset in either a PDF preset or app.pdfexportPreferences will do the job. I've wrote this function to create my flattener presets. Its based on the InDesign CS3 document preset sample script. If you replace the app.flattenerPresets array object with app.pdfexportPresets and replaces the preset attributes the function can be used to create PDF presets as well.

A big thanks to Thomas and Bal�zs for the kick(s) in the right direction. ;-)



function createFlattenerPreset(myPresetName){ 
   var myPreset = app.flattenerPresets.item(myPresetName); 
   try { 
      myPresetName = myPreset.name; 
      alert("Flattener preset found\nResetting preset attributes..."); 
      with(myPreset){ 
         rasterVectorBalance = 100; 
         lineArtAndTextResolution = 914; //Res12 output/2 
         gradientAndMeshResolution = 300; 
         convertAllTextToOutlines = false; 
         convertAllStrokesToOutlines = false; 
         clipComplexRegions = true; 
      } 
   } 
   catch(myError){ 
      alert("Flattener preset not found\nCreating preset with attributes..."); 
      myPreset = app.flattenerPresets.add( 
         { 
            name:myPresetName, 
            rasterVectorBalance:100, 
            lineArtAndTextResolution:914, //Res12 output/2 
            gradientAndMeshResolution:300, 
            convertAllTextToOutlines:false, 
            convertAllStrokesToOutlines:false, 
            clipComplexRegions:true 
         }          
      ); 
      var presets = app.flattenerPresets; 
      for(var i = 0; i < presets.length; i++){ 
         var ifFound; 
         if(presets.item(i).name == "myPreset"?ifFound = true:ifFound = false); 
      } 
      if(ifFound == true?alert("Preset succesfully created!"):alert("Houston we have a problem!")); 
   } 
}



Regards,
Rasmus
Re: [CS3 JS] A little help setting flattener prefs
#1383
Author: Rasmus_Olsen
Date: Thu, 12 Feb 2009 14:16
11 lines
855 bytes
Believe I've found a bug: 

      clipComplexRegions:true




When visually inspecting the flattener preset the value of this variable is beeing reported as N/A. This same goes for false as well. Hmm.

Regards,
Rasmus
Re: [CS3 JS] A little help setting flattener prefs
#1390
Author: Olav_Kvern
Date: Thu, 12 Feb 2009 21:14
7 lines
695 bytes
Hi Rasmus,

When rasterVectorBalance = 100, clipComplexRegions is not available.

Thanks,

Ole
Re: [CS3 JS] A little help setting flattener prefs
#1260
Author: Rasmus_Olsen
Date: Fri, 13 Feb 2009 07:57
5 lines
787 bytes
Hi Ole,

After consulting the "Transparency in Adobe Applications Print Production Guide" this makes perfectly sense. Thank you for correcting me.

Cheers!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads