Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This Gist contains code snippets related to Converting EPUB to PDF using C# .NET
This Gist contains code snippets related to Converting EPUB to PDF using C# .NET
// Get ClientID from https://dashboard.aspose.cloud/
string clientSecret = "caac6e3d4a4724b2feb53f4e460eade3";
string clientID = "4ccf1790-accc-41e9-8d18-a78dbb2ed1aa";
// Create an instance of PdfApi
PdfApi pdfApi = new PdfApi(clientSecret, clientID);
// input EPUB file
String inputFile = "Sway.epub";
// resultant PDF document
String resultant = "conveted.pdf";
try
{
// call the API to perform conversion
var response = pdfApi.PutEpubInStorageToPdf(resultant, inputFile);
// In case of success, print the success message
if (response != null )
{
Console.WriteLine("Successfully converted the EPUB to PDF !");
}
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment