We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Image is not visible when converting ai file to jpg. aspose.psd

I am using aspose total .net pre-purchase trial. Other functions work fine, but when I convert ai to jpg in aspose psd, no image comes out, just a blank screen. I uploaded the ai file to the demo provided by your company and confirmed that it was converted to normal. Is the image not showing because it is a trial version? please answer about my question. 3544901.zip (251.9 KB)

@casper77 Aspose.PSD has in its Roadmap support of all AI format versions. but at this moment please use Aspose.PDF to open AI file of new formats. Here is example of AI Viewer

Please check the following example:
If you trying to open old AI format please use Aspose.PSD:

	bool ConvertPsdAiToPng(Stream psdFileStream, string pngFileId, Size size)
	{
		psdFileStream.Position = 0;
		try
		{
			using var psdImage = PsdOpenerHelper.Load(psdFileStream, new PsdLoadOptions() { ReadOnlyMode = true });
			size.Width = psdImage.Width;
			size.Height = psdImage.Height;
			using var memStream = new MemoryStream();
			psdImage.Save(memStream, new PngOptions()
			{
				ColorType = PSD.FileFormats.Png.PngColorType.TruecolorWithAlpha
			});
			memStream.Position = 0;
			return true;
		}
		catch (Aspose.PSD.CoreExceptions.ImageLoadException ex)
		{
			return false;
		}
	}

If you use the new AI format then use this:

  bool ConvertPdfAiToPng(Stream pdfFileStream, string pngFileId, Size size)
  {
  	pdfFileStream.Position = 0;
  	try
  	{
  		using var pdfDocument = new Aspose.Pdf.Document(pdfFileStream);
  		var page = pdfDocument.Pages[1];
  		using var imageStream = new MemoryStream();
  		Resolution resolution = new Resolution(300);
  		PngDevice pngDevice = new PngDevice(size.Width, size.Height, resolution);
  		pngDevice.Process(page, imageStream);
  		imageStream.Position = 0;
  		imageStream.Close();
  		return true;
  	}
  	catch (Aspose.Pdf.InvalidPdfFileFormatException)
  	{
  		return false;
  	}
  }