Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active March 6, 2024 04:57
Show Gist options
  • Save blog-aspose-cloud/9ded7d1ce5cc97a514417651d7e27093 to your computer and use it in GitHub Desktop.
Save blog-aspose-cloud/9ded7d1ce5cc97a514417651d7e27093 to your computer and use it in GitHub Desktop.
photoshop to pdf
How to convert PSD to PDF using C# .NET
// For more examples, https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-dotnet/tree/master/Examples
// Get client credentials from https://dashboard.aspose.cloud/
string clientSecret = "c71cfe618cc6c0944f8f96bdef9813ac";
string clientID = "163c02a1-fcaa-4f79-be54-33012487e783";
// create an instance of ImagingApi class while passing client credentials as arguments
ImagingApi imagingApi = new ImagingApi(clientSecret, clientID, baseUrl: "https://api.aspose.cloud");
// load the input PSD file from local drive
using (var imageStream = System.IO.File.OpenRead("FilterEffectSampleImage.psd"))
{
// create an instance of CreateConvertedImageRequest where we specify input PSD file and desired output format as PDF
CreateConvertedImageRequest requestInstance = new CreateConvertedImageRequest(imageStream, "pdf", "Resultant.pdf");
// call the API to transfer PSD to PDF format and save the output in cloud storage
var resultant = imagingApi.CreateConvertedImage(requestInstance);
if(resultant != null && resultant.Equals("OK"))
{
// print success message
Console.WriteLine("PSD to PDF exported successfully !");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment