import aspose.pdf as pdf

# Set the source PDF directory path
filePath = "C://Words//"

# Set the product license in your application to convert PDF file to JPEG images
pdfToPngLicense = pdf.License()
pdfToPngLicense.set_license(filePath + "Conholdate.Total.Product.Family.lic")

#Access the source PDF file document from the disk
pdfDoc = pdf.Document(filePath + "Output.pdf")

#Instantiate the JPEG devise for rendering
resolution = pdf.devices.Resolution(300)
jpegDevice = pdf.devices.JpegDevice(resolution)

count=1
#for (int pageCount = 1; pageCount <= document.Pages.Count; pageCount++)
for pdfPage in pdfDoc.pages:

    #Convert a particular PDF page and save that as JPEG image
    jpegDevice.process(pdfPage, filePath+"image"+ str(count) +"_out.jpeg")
    count = count + 1

print("JPEG Rendering process completed")