Converting AI files to JPG image is simple. You need to follow the steps below:
- Load input AI file with AiImage class
- Set ImageOptionsBase properties
- Save output JPG image
Following code snippet shows how to convert AI to JPG in C# applications:
string[] sourcesFiles = new string[]
{
@"34992OStroke",
@"rect2_color",
};
for (int i = 0; i < sourcesFiles.Length; i++)
{
string name = sourcesFiles[i];
string sourceFileName = dataDir + name + ".ai";
string outFileName = dataDir + name + ".jpg";
using (AiImage image = (AiImage)Image.Load(sourceFileName))
{
ImageOptionsBase options = new JpegOptions() { Quality = 85 };
image.Save(outFileName, options);
}
}
'C#' 카테고리의 다른 글
How to Convert AI to PDF Using C# (0) | 2022.01.20 |
---|
댓글