摘要: 下面示例代码,是将横向纸张旋转为纵向(根据纸张大小判断纸张方向) 方法一:使用`PyPDF2`库 ```python from PyPDF2 import PdfFileWriter, PdfFileReader def page_rotation(old_file, new_file): """ 阅读全文
posted @ 2021-07-01 17:11 cnblogs用户 阅读(1499) 评论(1) 推荐(0) 编辑
摘要: 实现WPS文件转PDF,需要安装金山WPS ```python import os from win32com.client import Dispatch def wps_et_to_pdf(file, pdf_file=None): """ wps/et 转 PDF :param file: w 阅读全文
posted @ 2021-07-01 17:06 cnblogs用户 阅读(867) 评论(0) 推荐(0) 编辑
摘要: ```python import os from PIL import Image from reportlab.pdfgen import canvas def image_resize(img, width, height): """ 图片缩放 :param img: 图片路径 :param w 阅读全文
posted @ 2021-07-01 16:53 cnblogs用户 阅读(683) 评论(0) 推荐(0) 编辑