在线打开 AI 文件
当你在线打开 AI 格式时不需要编辑功能时,这款 AI Viewer 是一个很好的解决方案,可用于多种用途。上传到 Web 服务器后,您可以在线打开 AI 文件。AI 格式是一种矢量格式,因此栅格化将以指定的图像大小进行。对于其他功能,您可以使用 .Net 要么 Java 高代码 API 可在您需要的尺寸中打开 AI 文件
Drag and drop a file or click Open Image
You can reproduce the main functionality of this built-in app using Aspose.PSD
// For the new AI format please use the following code: async Task<bool> OpenPdfToPng(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; await StorageService.Upload(pngFileId, imageStream); imageStream.Close(); return true; } catch (Aspose.Pdf.InvalidPdfFileFormatException) { return false; } } // For the Old AI Formats please use the Aspose.PSD high-code API using (AiImage image = (AiImage)Image.Load(sourceFileName)) { ImageOptionsBase options = new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha }; image.Save(outFileName, options); }
You can download Aspose.PSD from Nuget package manager
Check the following list of documentation links:
Please check the offical documentation https://docs.aspose.com/psd/
使用 Aspose.PSD 或其他 Aspose 产品打开 AI 文件。在线渲染 AI 文件预览。