Please follow the steps given below to convert PDF to EPUB using Aspose.PDF Cloud SDK for Python.
For more information, please visit the following blog Convert PDF to EPUB using Python.
Please follow the steps given below to convert PDF to EPUB using Aspose.PDF Cloud SDK for Python.
For more information, please visit the following blog Convert PDF to EPUB using Python.
This Gist contains code snippets for converting PDF to EPUB using Aspose.PDF Cloud SDK for Python |
def PDFtoEPUB(): | |
try: | |
#Client credentials | |
client_secret = "1c9379bb7d701c26cc87e741a29987bb" | |
client_id = "bbf94a2c-6d7e-4020-b4d2-b9809741374e" | |
#initialize PdfApi client instance using client credetials | |
pdf_api_client = asposepdfcloud.api_client.ApiClient(client_secret, client_id) | |
# create PdfApi instance while passing PdfApiClient as argument | |
pdf_api = PdfApi(pdf_api_client) | |
# input PDF file | |
input_file = 'marketing.pdf' | |
# resultant EPUB file name | |
output_file = 'converted.epub' | |
# Set content flow recognition value | |
contentRecognition = 'Fixed' | |
# call the API to convert PDF to EPUB and save resultant to Cloud storage | |
response = pdf_api.put_pdf_in_storage_to_epub(name = input_file, out_path= output_file, content_recognition_mode= contentRecognition) | |
# print response code in console | |
print(response) | |
# print message in console (optional) | |
print('PDF successfully converted to EPUB !') | |
except ApiException as e: | |
print("Exception while calling PdfApi: {0}".format(e)) | |
print("Code:" + str(e.code)) | |
print("Message:" + e.message) |