0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

vistaでillustrator

Last updated at Posted at 2022-02-01

概要

vistaでillustratorやってみる。
アートボード作って、文字書いて、png出力してみた。

環境

windows vista
illustrator cs2

写真

ill0.png

サンプルコード

var docRef = documents.add(DocumentColorSpace.RGB, 800, 800);
var textRef1 = docRef.textFrames.add();
textRef1.contents = "Scripting is fun!";
textRef1.top = 700;
textRef1.left = 50;
var textRef2 = docRef.textFrames.add();
textRef2.contents = "Scripting is easy!";
textRef2.top = 625;
textRef2.left = 100;
var textRef3 = docRef.textFrames.add();
textRef3.contents = "Everyone should script!";
textRef3.top = 550;
textRef3.left = 150;
var charStyle = docRef.characterStyles.add("BigRed");
var charAttr = charStyle.characterAttributes;
charAttr.size = 40;
charAttr.tracking = -50;
charAttr.capitalization = FontCapsOption.ALLCAPS;
var redColor = new RGBColor();
redColor.red = 255;
redColor.green = 0;
redColor.blue = 0;
charAttr.fillColor = redColor;
charAttr.textFont = app.textFonts[4]
charStyle.applyTo(textRef1.textRange);
charStyle.applyTo(textRef2.textRange);
charStyle.applyTo(textRef3.textRange);
var pngOpt = new ExportOptionsPNG24();
pngOpt.artBoardClipping = true;
var filePath = new File("/Users/ore/ill0.png");
activeDocument.exportFile(filePath, ExportType.PNG24, pngOpt);
alert("ok");



以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?