摘要: 下面示例代码,是将横向纸张旋转为纵向(根据纸张大小判断纸张方向) 方法一:使用`PyPDF2`库 ```python from PyPDF2 import PdfFileWriter, PdfFileReader def page_rotation(old_file, new_file): """ 阅读全文
posted @ 2021-07-01 17:11 cnblogs用户 阅读(1733) 评论(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用户 阅读(951) 评论(0) 推荐(0) 编辑
摘要: import os from PIL import Image from reportlab.pdfgen import canvas def image_resize(img, *args, multiple=None): """ 图片缩放 如果按倍数缩放图片,则不用传args, 否则要传入需要缩 阅读全文
posted @ 2021-07-01 16:53 cnblogs用户 阅读(700) 评论(0) 推荐(0) 编辑