Aspose.PSD for .NET 24.1 (DLLs-only package) has been released! With this update, we have introduced new functionalities to handle multi-page AI images and resolved several issues.
Easily Handle Multi-Page AI Images
Conveniently perform basic operations on multi-page AI (Adobe Illustrator Artwork) files and handle AI images with this C# PSD API release. This update enables you to programmatically fetch and save individual pages, as showcased in the below-given C# code example.
string sourceFile = Path.Combine(baseFolder, "threePages.ai");
string firstPageOutputPng = Path.Combine(outputFolder, "firstPageOutput.png");
string secondPageOutputPng = Path.Combine(outputFolder, "secondPageOutput.png");
string thirdPageOutputPng = Path.Combine(outputFolder, "thirdPageOutput.png");
// Load the AI image.
using (AiImage image = (AiImage)Image.Load(sourceFile))
{
// By default, the ActivePageIndex is 0.
// So if you save the AI image without changing this property, the first page will be rendered and saved.
image.Save(firstPageOutputPng, new PngOptions());
// Change the active page index to the second page.
image.ActivePageIndex = 1;
// Save the second page of the AI image as a PNG image.
image.Save(secondPageOutputPng, new PngOptions());
// Change the active page index to the third page.
image.ActivePageIndex = 2;
// Save the third page of the AI image as a PNG image.
image.Save(thirdPageOutputPng, new PngOptions());
}
Source*
Enhanced Text Warp Rendering
With the latest Aspose.PSD for .NET release, the issues related to the rendering of warp text effects in PSD files have been resolved. Please check out the following code sample which demonstrates how to apply the warp text effect in C#:
string sourceFile = Path.Combine(baseFolder, "text_warp.psd");
string outputFile = Path.Combine(outputFolder, "export.png");
var opt = new PsdLoadOptions()
{
LoadEffectsResource = true,
AllowWarpRepaint = true
};
using (PsdImage img = (PsdImage)Image.Load(sourceFile, opt))
{
img.Save(outputFile, new PngOptions() { CompressionLevel = 9, ColorType = PngColorType.TruecolorWithAlpha });
}
Source*
Mask Rendering Improvements
This .NET library release includes the fix for the problems with mask rendering in specific PSD files. This C# code sample illustrates how to use this feature within your PSD processing applications:
string sourceFile1 = Path.Combine(baseFolder, "mask_problem.psd");
string sourceFile2 = Path.Combine(baseFolder, "puh_softLight3_1.psd");
string outputFile1 = Path.Combine(outputFolder, "mask_export.png");
string outputFile2 = Path.Combine(outputFolder, "puh_export.png");
var opt = new PsdLoadOptions()
{
LoadEffectsResource = true,
};
using (PsdImage img = (PsdImage)Image.Load(sourceFile1, opt))
{
img.Save(outputFile1, new PngOptions() { CompressionLevel = 9, ColorType = PngColorType.TruecolorWithAlpha }); ;
}
using (PsdImage img = (PsdImage)Image.Load(sourceFile2, opt))
{
img.Save(outputFile2, new PngOptions() { CompressionLevel = 9, ColorType = PngColorType.TruecolorWithAlpha }); ;
}
Source*
Optimized Memory Usage for AI Export
.NET developers can work with optimized memory usage during AI image export in the latest version of the C# API. This update helps improve performance while processing large files. The following coding example showcases the feature usage:
string sourceFile = Path.Combine(baseFolder, "threePages.ai");
string firstPageOutputPng = Path.Combine(outputFolder, "firstPageOutput.png");
string secondPageOutputPng = Path.Combine(outputFolder, "secondPageOutput.png");
string thirdPageOutputPng = Path.Combine(outputFolder, "thirdPageOutput.png");
// Load the AI image.
using (AiImage image = (AiImage)Image.Load(sourceFile))
{
// By default, the ActivePageIndex is 0.
// So if you save the AI image without changing this property, the first page will be rendered and saved.
image.Save(firstPageOutputPng, new PngOptions());
// Change the active page index to the second page.
image.ActivePageIndex = 1;
// Save the second page of the AI image as a PNG image.
image.Save(secondPageOutputPng, new PngOptions());
// Change the active page index to the third page.
image.ActivePageIndex = 2;
// Save the third page of the AI image as a PNG image.
image.Save(thirdPageOutputPng, new PngOptions());
}
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.PSD for .NET 24.1 Release Notes.