def convertToPdf(self):
    directory = (('./' + self.list['readableProduct']['title']) + '/')
    sourceDir = os.listdir(directory)
    imgcount = 0
    img = []
    filextend = sourceDir[0].split('.')
    filextend = (str('.') + str(filextend[1]))
    for images in sourceDir:
        img.append(((directory + str(imgcount)) + filextend))
        imgcount = (imgcount + 1)
    with open((('./' + self.list['readableProduct']['title']) + '.pdf'), 'wb') as f:
        f.write(img2pdf.convert(img))
def convertToPdf(self):
    directory = (('./' + self.list['readableProduct']['title']) + '/')
    sourceDir = os.listdir(directory)
    imgcount = 0
    img = []
    filextend = sourceDir[0].split('.')
    filextend = (str('.') + str(filextend[1]))
    for images in sourceDir:
        img.append(((directory + str(imgcount)) + filextend))
        imgcount = (imgcount + 1)
    with open((('./' + self.list['readableProduct']['title']) + '.pdf'), 'wb') as f:
        f.write(img2pdf.convert(img))