将AI转为PDF

Contents
[ ]

Aspose.PSD提供将AI文件转换为PDF文件的功能。要导出Ai,您需要使用以下代码片段:

以下提供的示例代码演示了如何使用文件格式操作API将AI文件导出为PDF。

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
string outFileName = "rect2_color.pdf";
ImageOptionsBase pdfOptions = new PdfOptions();
using (AiImage image = (AiImage)Image.Load(sourceFileName))
{
image.Save(outFileName, pdfOptions);
}

您可以在PdfOptions中指定其他PDF参数,如作者、关键词、主题、标题。

将AI文件批量处理成PDF可以用于业务自动化。PDF格式无法像PSD文件那样进行编辑。PDF格式无法更改,因此您可以将其用作与客户或合作伙伴协作的不可更改格式。

附加示例

以下是另一个示例,演示了如何使用特定的PDF合规设置将AI文件导出为PDF:

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
string outFileNamePdfA1a = "rect2_color.pdf";
var pdfOptionsPdfA1a = new PdfOptions();
pdfOptionsPdfA1a.PdfCoreOptions = new PdfCoreOptions();
pdfOptionsPdfA1a.PdfCoreOptions.PdfCompliance = PdfComplianceVersion.PdfA1a;
using (AiImage image = (AiImage)Image.Load(sourceFileName))
{
image.Save(outFileNamePdfA1a, pdfOptionsPdfA1a);
}

PdfComplianceVersion.PdfA1a选项确保生成的PDF符合PDF/A-1a标准,该标准是ISO标准化PDF规范组中的一部分。PDF/A-1a设计用于电子文档的长期存档,并确保PDF是自包含的,包括显示文档所需的所有信息,无论使用何种工具,都能以相同的方式显示文档。