c# - 如何使用以及在哪里可以找到 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 微小格式。函数 app.ActiveDocument.Export 可以做到。它有 3 个参数:文件名、格式和参数。需要的参数:小数位=1 和图像位置=链接,因为它最适合我的解析器。
当然,我无法搜索如何在此功能中包含这些选项的任何信息。请不要向我推荐任何其他库或inkscape。谢谢
解决方案
你可以在枚举中找到你的小 svg 1.2 版本
Illustrator.AiSVGDTDVersion.aiSVGTiny1_2
也许你认为你可以创建选项类的对象:
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);
推荐阅读
- java - Kafka、Quarkus 和 Avro 在同一主题中的几种事件类型
- laravel-7 - 用户首次在 Laravel 7 中注册后如何重定向到动态路由
- jmeter - 我们可以停止 JMeter 负载测试自动停止吗
- angular - 角度请求返回 NET::ERR_CERT_AUTHORITY_INVALID
- java - java中小型静态数据集的内存自动完成实现
- javascript - 如何在不更改原始属性的情况下从角度 ReactiveForm 中删除属性?
- mysql - '字段列表'mysql中的未知列''
- elasticsearch - 如何在搜索查询中编写条件?
- loops - 用于循环的 Pine 脚本
- angular - (Angular)为什么我的数组没有变空?