在PDF的末尾添加空白页,该页面的页面数量较少
我有两个PDF文件,我的问题是阅读两个PDF文件,并掩盖了图像文件。我想将空白页面添加到PDF的末尾,该页面的页面数量较少,以便两个PDF中的页面数量相同。我的问题是如何使用Python在PDF中比较和添加空白页面?任何关于此的指示都会有所帮助。
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))
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))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论