Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script to save as AI file with outlined type.

Community Beginner ,
May 02, 2017 May 02, 2017

Hello,

I have had some success in altering the generic SaveAsPDF scripts that come with Illustrator to suit my PDF workflow. I would now like to take one of these scripts and turn it into one that will save an AI file with all of the type outlined.

I am using the 2014 Java Scripting Guide, and have located this snippet, which is used to export to an Illustrator 8 file.

function exportFileToAI (dest) {

   if ( app.documents.length > 0 ) {

      var saveOptions = new IllustratorSaveOptions();

      var ai8Doc = new File(dest);

      saveOptions.compatibility = Compatibility.ILLUSTRATOR8;

      saveOptions.flattenOutput = OutputFlattening.PRESERVEAPPEARANCE;

      app.activeDocument.saveAs( ai8Doc, saveOptions );

   }

}

Using this as a starting point, what would you suggest? I found convertTextToOutlines in PrintFlattenerOptions. Only thing is that I only want to outline the live type...

Would it be something like...

var flattenOptions = new PrintFlattenerOptions();

flattenOptions.convertTextToOutlines = true

TOPICS
Scripting
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Beginner ,
May 02, 2017 May 02, 2017

I found this in another thread and wonder if using an action to outline the type would be better since I don't want to flatten the transparency... just want to convert the live type to outlines.

  1.  
  2. function FlattenOutline() { 
  3.     var set = 'script action'
  4.         action = 'outline text'
  5.  
  6.  
  7.     createAction(); 
  8.     for (i = 0; i < sourceDoc.layers.length; i++) { 
  9.         app.selection = null
  10.         sourceDoc.layers.locked = false
  11.         sourceDoc.layers.hasSelectedArtwork = true
  12.         app.doScript(action, set); 
  13.     } 
  14.     app.unloadAction(set, ''); 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
May 03, 2017 May 03, 2017

Are you just going to put someone's answer into your own snippet and mark it as correct? Technically, there's nothing wrong with that as long as the actual answer gets answered.

Use this:

app.executeMenuCommand("outline");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 03, 2017 May 03, 2017
LATEST

I did not mean to mark it as correct... If I did, it was by mistake. Thanks for your reply.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines