PSBファイルをJPEGに変換する
Aspose.PSD for .NETを使用すると、開発者はPSBファイル形式をJPEGファイル形式に変換することができます。このトピックでは、既存のPSBファイルをロードしてJPEGファイル形式に変換するアプローチについて説明します。
// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET | |
string[] sourceFileNames = new string[] { | |
//Test files with layers | |
"Little", | |
"Simple", | |
//Test files without layers | |
"psb", | |
"psb3" | |
}; | |
var options = new PsdLoadOptions(); | |
foreach (var fileName in sourceFileNames) | |
{ | |
var sourceFileName = dataDir + fileName + ".psb"; | |
using (PsdImage image = (PsdImage)Image.Load(sourceFileName, options)) | |
{ | |
// All jpeg and psd files must be readable | |
image.Save(dataDir + fileName + "_output.jpg", new JpegOptions() { Quality = 95 }); | |
image.Save(dataDir + fileName + "_output.psb"); | |
} | |
} |
PSBファイルをPSDに変換する
Aspose.PSD for .NETを使用すると、開発者はPSBをPSDファイル形式に変換することができます。この記事では、Aspose.PSDを使用してPSBファイルをPSD形式にエクスポート/変換する方法を示します。Aspose.PSD for .NETは、PSBファイルをロードするためにImageクラスが公開するLoadメソッドを提供し、同様に結果を保存するために使用できます。次のコードスニペットは、PSBをPSDファイルに変換する方法を示しています。
// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET | |
string sourceFilePathPsb = dataDir + "2layers.psb"; | |
string outputFilePathPsd = dataDir + "ConvertFromPsb.psd"; | |
using (Image img = Image.Load(sourceFilePathPsb)) | |
{ | |
var options = new PsdOptions((PsdImage)img) { PsdVersion = PsdVersion.Psd }; | |
img.Save(outputFilePathPsd, options); | |
} |
Aspose.PSD for .NETを使用すると、開発者はPSBをPDFファイル形式に変換することができます。この記事では、Aspose.PSDを使用してPSBファイルをPDF形式にエクスポート/変換する方法を示します。Aspose.PSD for .NETは、PSBファイルをロードするためにImageクラスが公開するLoadメソッドを提供し、同様に結果を保存するために使用できます。Imageクラスをリンクしたこちらのページでは、PDFの作成オプションであるPdfOptionsクラスについて詳細に説明されており、PageSize(https://reference.aspose.com/psd/net/aspose.psd.imageoptions/pdfoptions/properties/pagesize)、JpegQualityなどのオプションを使用してPDFの所望の標準を取得することができます。
PSBファイルをPDFに変換する
次のコードスニペットは、PSBをPDFファイルに変換する方法を示しています。
// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET | |
string sourceFileName = dataDir + "Simple.psb"; | |
using (PsdImage image = (PsdImage)Image.Load(sourceFileName)) | |
{ | |
string outFileName = dataDir + "Simple.pdf"; | |
image.Save(outFileName, new PdfOptions()); | |
} |