令人兴奋的是,.NET版Aspose.PSD迎来了3月的最新更新!新增了如下六大新功能:支持.Net Core、将Adobe Illustrator文件转换为PDF、增加在一个文本层中呈现不同样式的功能、支持黑白调整层、添加对导出AI格式(版本8)的支持,以支持其他格式、支持PassThrough混合模式处理(仅用于图层组) 。
令人兴奋的是,.NET版Aspose.PSD迎来了3月的最新更新!新增了如下六大新功能:
- 支持.Net Core
- 将Adobe Illustrator文件转换为PDF
- 增加在一个文本层中呈现不同样式的功能
- 支持黑白调整层
- 添加对导出AI格式(版本8)的支持,以支持其他格式
- 支持PassThrough混合模式处理(仅用于图层组)
>>你可以点击这里下载Aspose.PSD for .NET v20.2测试体验
具体更新内容
key | 概述 | 类别 |
---|---|---|
PSDNET-188 | 支持.Net Core | 新功能 |
PSDNET-523 | 将Adobe Illustrator文件转换为PDF | 新功能 |
PSDNET-212 | 增加在一个文本层中呈现不同样式的功能 | 新功能 |
PSDNET-144 | 支持黑白调整层 | 新功能 |
PSDNET-233 | 添加对导出AI格式(版本8)的支持,以支持其他格式 | 新功能 |
PSDNET-540 | 支持PassThrough混合模式处理(仅用于图层组) | 新功能 |
PSDNET-539 | 异常:加载具有空Unicode Alpha名称资源的图像时,图像加载失败 | Bug修复 |
PSDNET-541 | 更改LayerGroup的可见性后输出不正确 | Bug修复 |
PSDNET-516 | 加载PSD图像时的异常:颜色部分(DropShadow资源)必须包含RGB的3个颜色分量或CMYK的4个颜色分量 | Bug修复 |
PSDNET-536 | 如果使用简单版本的Constructor尝试在新创建的图层上绘制,则为异常 | Bug修复 |
用法示例
PSDNET-523 将Adobe Illustrator文件转换为PDF
string sourceFile = "rect2_color.ai";using (var aiImage = (AiImage)Image.Load(sourceFile)){ aiImage.Save("rect2_color.ai_output.pdf", new PdfOptions());}
PSDNET-212 增加在一个文本层中呈现不同样式的功能
string sourceFile = "text212.psd";string ethalonFile = "Ethalon_text212.psd";string outputFile = "Output_text212.psd";using (var img = (PsdImage)Image.Load(sourceFile)){ TextLayer textLayer = (TextLayer)img.Layers[1]; IText textData = textLayer.TextData; ITextStyle defaultStyle = textData.ProducePortion().Style; ITextParagraph defaultParagraph = textData.ProducePortion().Paragraph; defaultStyle.FillColor = Color.DimGray; defaultStyle.FontSize = 51; textData.Items[1].Style.Strikethrough = true; ITextPortion[] newPortions = textData.ProducePortions(new string[] { "E=mc", "2r", "Bold", "Italicr", "Lowercasetext" }, defaultStyle, defaultParagraph); newPortions[0].Style.Underline = true; // edit text style "E=mc" newPortions[1].Style.FontBaseline = FontBaseline.Superscript; // edit text style "2r" newPortions[2].Style.FauxBold = true; // edit text style "Bold" newPortions[3].Style.FauxItalic = true; // edit text style "Italicr" newPortions[3].Style.BaselineShift = -25; // edit text style "Italicr" newPortions[4].Style.FontCaps = FontCaps.SmallCaps; // edit text style "Lowercasetext" foreach (var newPortion in newPortions) { textData.AddPortion(newPortion); } textData.UpdateLayerData(); img.Save(outputFile);}
PSDNET-540 支持PassThrough混合模式处理(仅用于图层组)
voidAssertIsTrue(bool condition, string message){ if(!condition) { thrownewFormatException(message); }}string sourceFileName ="Apple.psd";string outputFileName ="Output"+ sourceFileName;using (PsdImage image = (PsdImage)Image.Load(sourceFileName)){ AssertIsTrue(image.Layers.Length >=23,"There is not 23rd layer."); var layer = image.Layers[23] as LayerGroup; AssertIsTrue(layer !=null,"The 23rd layer is not a layer group."); AssertIsTrue(layer.Name =="AdjustmentGroup","The 23rd layer name is not 'AdjustmentGroup'."); AssertIsTrue(layer.BlendModeKey == BlendMode.PassThrough,"AdjustmentGroup layer should have 'pass through' blend mode."); image.Save(outputFileName,newPsdOptions()); image.Save("OutputApple.png",newPngOptions() { ColorType = PngColorType.TruecolorWithAlpha }); layer.BlendModeKey = BlendMode.Normal; image.Save("Normal"+ outputFileName,newPsdOptions()); image.Save("NormalOutputApple.png",newPngOptions() { ColorType = PngColorType.TruecolorWithAlpha });}
PSDNET-233 添加对导出AI格式(版本8)的支持,以支持其他格式
// Example of exporting AI file to PSD and PNG formatstring sourceFileName = "form_8.ai";string outputFileName = "form_8_export";using (AiImage image = (AiImage)Image.Load(sourceFileName)){ image.Save(outputFileName + ".psd", new PsdOptions()); image.Save(outputFileName + ".png", new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });}
还想要更多吗可以点击阅读【2019 · Aspose最新资源整合】,查找需要的教程资源。如果您有任何疑问或需求,请随时联系客服,我们很高兴为您提供查询和咨询。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!