PSD를 PDF로 변환

Aspose.PSD for .NET은 PSD 파일을 로드하고 이미지를 PDF 형식으로 저장할 수 있는 Image 클래스를 제공합니다. 아래 제공된 샘플 코드는 PSD를 PDF로 변환하는 방법을 보여줍니다.

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
// Add support of PSD export to PDF
string[] sourcesFiles = new string[]
{
@"1.psd",
@"little.psb",
@"psb3.psb",
@"inRgb16.psd",
@"ALotOfElementTypes.psd",
@"ColorOverlayAndShadowAndMask.psd",
@"ThreeRegularLayersSemiTransparent.psd"
};
for (int i = 0; i < sourcesFiles.Length; i++)
{
string sourceFileName = sourcesFiles[i];
using (PsdImage image = (PsdImage)Image.Load(dataDir + sourceFileName))
{
string outFileName = "PsdToPdf" + i + ".pdf";
image.Save(dataDir + outFileName, new PdfOptions());
}
}

클리핑 마스크로 PSD를 PDF로 변환

클리핑 마스크를 사용하면 한 번에 여러 레이어에 마스크를 적용할 수 있습니다. 이 기사는 클리핑 마스크로 PSD를 PDF로 내보내는 방법을 보여줍니다. 이 기능을 구현하는 데 아래에 샘플 코드가 제공되었습니다.

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
using (PsdImage image = (PsdImage)Image.Load(dataDir + "clip.psd"))
{
image.Save(dataDir + "output.pdf", new PdfOptions());
}

조정 레이어와 함께 PSD를 PDF로 변환

조정 레이어는 픽셀 값을 영구적으로 변경하지 않고 이미지에 색상 및 톤 조정을 적용하는 레이어입니다. 이 기사에서는 조정 레이어와 함께 PSD를 PDF로 내보내는 방법을 보여줍니다. 아래 코드 스니펫이 제공되었습니다.

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
using (PsdImage image = (PsdImage)Image.Load(dataDir + "example.psd"))
{
image.Save(dataDir + "document.pdf", new PdfOptions());
}

PSD 파일을 PSB로 변환

Aspose.PSD for .NET을 사용하면 PSD를 PSB 파일 형식으로 변환할 수 있습니다. 이 기사에서는 Aspose.PSD를 사용하여 PSD 파일을 PSB 형식으로 내보내는 방법을 보여줍니다. Aspose.PSD for .NET은 Image 클래스에 의해 노출된 Load 메서드를 제공하여 PSD 파일을 로드하고 결과를 저장하는 데 사용할 수 있습니다. 다음 코드 스니펫은 PSD를 PSB 파일로 변환하는 방법을 보여줍니다.

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
string sourceFilePathPsd = dataDir + "2layers.psd";
string outputFilePathPsb = dataDir + "ConvertFromPsd.psb";
using (Image img = Image.Load(sourceFilePathPsd))
{
var options = new PsdOptions((PsdImage)img) { PsdVersion = PsdVersion.Psb };
img.Save(outputFilePathPsb, options);
}