Ai to PDF
Aspose.PSD provides functionality to convert AI files to PDF files. For Ai export you need to use the following code snippet:
Below provided sample code demonstrates how to export the AI file to PDF with the File Format Manipulation API
// 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); | |
} |
You can specify additional PDF parameters in PdfOptions, like Author, Keywords, Subject, Title.
Mass server processing of AI files to PDF can be useful for business automation. PDF format can not be edited as a PSD file. PDF Format can not be changed, so you can use it as an unchangeable format to work with your customers or partners.
Additional Example
Here is another example demonstrating how to export an AI file to PDF with specific PDF compliance settings:
// 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); | |
} |
The PdfComplianceVersion.PdfA1a option ensures that the generated PDF meets the PDF/A-1a standard, which is a part of the PDF/A family of ISO-standardized PDF specifications. PDF/A-1a is designed for long-term archiving of electronic documents and ensures that the PDF is self-contained, including all information necessary for displaying the document in the same manner regardless of the tools used.