I have two PDF file,My problem is read two pdf file and covert to image file. I want to add blank pages to the end of the PDF which has less number of pages, so that the number of pages in both PDFs is same. My question is how to compare and add blank pages to the PDF using python? Any pointers on this would be helpful.
list_im = []
images = convert_from_path(r"/home/hp/PycharmProjects/DHT/pdf_comparison/pdf/project plan1-2.pdf")
for i in range(len(images)):
min_shape = sorted([(np.sum(i.size), i.size) for i in images])[0][1]
imgs_comb_1 = np.hstack((np.asarray(i.resize(min_shape)) for i in images))
imgs_comb_1 = np.vstack((np.asarray(i.resize(min_shape)) for i in images))
images = convert_from_path(r"/home/hp/PycharmProjects/DHT/pdf_comparison/pdf/project plan1-1.pdf")
for i in range(len(images)):
min_shape = sorted([(np.sum(i.size), i.size) for i in images])[0][1]
imgs_comb_2 = np.hstack((np.asarray(i.resize(min_shape)) for i in images))
imgs_comb_2 = np.vstack((np.asarray(i.resize(min_shape)) for i in images))