在 Adob​​e Illustrator api C# 中如何使用以及在哪里可以找到导出参数

how to use and where i can find export params in Adobe Illustrator api C#

我在我的应用程序中使用 illustrator api

    Illustrator.Application app = new Illustrator.Application();
    app.Open("D:\1\2\1.svg");
    app.ActiveDocument.Activate();
    app.ActiveDocument.Export("D:\1\2\1_1.svg", Illustrator.AiExportType.aiSVG);
    app.ActiveDocument.Close(Illustrator.AiSaveOptions.aiDoNotSaveChanges);

我想使用 illustrator 格式将我的 svg 转换为 1.2 tiny 格式。 函数 app.ActiveDocument.Export 可以做到。它有 3 个参数:文件名、格式和参数。 需要的参数:小数位=1 和图像位置=link,因为它最适合我的解析器。

当然,我无法搜索任何有关如何将这些选项包含在此函数中的信息。 请不要向我推荐任何其他图书馆或 inkscape。 谢谢

您可以在枚举中找到您的 tiny svg 1.2 版本

Illustrator.AiSVGDTDVersion.aiSVGTiny1_2

也许您认为可以创建选项对象 class:

Illustrator.ExportOptionsSVGClass

但是当您尝试创建这些对象时,您会收到错误消息。 您的解决方案是:

var options = new ExportOptionsSVG();
            options.SVGTextOnPath = true;
            options.IncludeUnusedStyles = false;
            options.IncludeFileInfo = false;
            options.EmbedRasterImages = true;
            options.DTD = AiSVGDTDVersion.aiSVGTiny1_2;
            app.ActiveDocument.Export("path", AiExportType.aiSVG, options);