Adobe Illustrator files are majorly used to represent visual information. Moreover, graphic designers transform their creative ideas into masterpieces using AI files. Sometimes you need to convert AI to raster images (PNG, JPG, etc) or PDF file in C#. The most important and exciting factor of all these conversions is that you do not need to install or configure the Adobe Illustrator application because Aspose.PSD for .NET API is capable of converting AI files without any dependency on 3rd party applications. Let us move on to the following use cases in this blog post:

It is important to note here that we will be considering two different AI files as input for a few examples below. One of the input AI file has different paths weight and the other AI file contains complex contours. So let us check out the screenshots for the AI files we will be working with:

AI File with Different Path Weights

AI to PNG C#

AI File Containing Complex Contours

AI to JPG C#

Convert AI to PNG with C#

You can enhance your .NET applications to process AI files and convert it to a PNG image. PNG images are quite famous and are often the criteria for submitting images in online forms. So you can follow the below steps to convert AI to PNG files:

  1. Load source AI file
  2. Set properties of PngOptions class
  3. Save AI file as PNG image in C#

Following code snippet is based on the above steps, which shows how to convert AI to PNG with C#:

Convert AI to JPG with C#

Converting AI files to JPG image is simple. You need to follow the steps below:

  1. Load input AI file with AiImage class
  2. Set ImageOptionsBase properties
  3. Save output JPG image

Following code snippet shows how to convert AI to JPG in C# applications:

Convert AI to PSD with C#

PSD files are photoshop documents that contain layered images. You can convert AI to PSD without using Adobe Photoshop or Adobe Illustrator. Follow the steps below in order to perform the conversion:

  1. Load AI input file
  2. Initialize object of PsdOptions class
  3. Save output PSD file as a result

Likewise, the code snippet below shows how to convert AI to PSD in C# .NET applications:

Convert AI to PDF with C#

PDF files format is famous because almost all platforms support .pdf file extension. Moreover, the PDF files are prone to changes and modifications unless permitted by the author of the document. Sometimes you might need to share content with partners or customers without allowing them for any modifications. Therefore, AI to PDF conversion is helpful in such scenarios. You need to follow the below steps to perform the conversion:

  1. Load source AI file
  2. Declare an instance of PdfOptions class
  3. Save output PDF file consequently

Following code snippet shows how to convert AI to PDF with C#:

Conclusion

In short, AI files can be rendered to different file formats with Aspose.PSD for .NET API. For example, we have explored how to convert AI to PNG, AI to JPG, AI to PSD as well as AI to PDF file formats. So you can visit the API documentation and API references to learn more about the API. Moreover, we appreciate your feedback or queries at Free Support Forum.

See Also