摘要: # 首先制作水印文件 打开word制作一个只有水印的页面,保存为PDF from PyPDF2 import PdfFileReader, PdfFileWriter from copy import copy # 合并PDF水印 watermark_pdf = PdfFileReader('水印. 阅读全文
posted @ 2020-09-04 19:16 不会飞的鲨鱼 阅读(1064) 评论(0) 推荐(0) 编辑
摘要: # 安装 pip install pypdf2 from PyPDF2 import PdfFileReader, PdfFileWriter # 用pypdf2旋转PDF某一页 pdf_reader = PdfFileReader('基于python的网页爬虫.pdf') pdf_writer = 阅读全文
posted @ 2020-09-04 19:14 不会飞的鲨鱼 阅读(1718) 评论(0) 推荐(0) 编辑
摘要: # 安装 pip install pypdf2 import os from PyPDF2 import PdfFileReader, PdfFileWriter dir_name = '分割后PDF文件' if not os.path.exists(dir_name): os.mkdir(dir_ 阅读全文
posted @ 2020-09-04 19:13 不会飞的鲨鱼 阅读(657) 评论(0) 推荐(0) 编辑
摘要: # 安装 pip install pdfplumber import pdfplumber # 利用pdfplumber提取文字 with pdfplumber.open('基于python的网页爬虫.pdf') as pdf: first_page = pdf.pages[0] print(fir 阅读全文
posted @ 2020-09-04 19:11 不会飞的鲨鱼 阅读(3029) 评论(0) 推荐(0) 编辑
摘要: from pptx import Presentation from pptx.util import Cm, Pt from pptx.enum.text import MSO_VERTICAL_ANCHOR, PP_PARAGRAPH_ALIGNMENT from pptx.dml.color 阅读全文
posted @ 2020-09-04 19:10 不会飞的鲨鱼 阅读(2022) 评论(0) 推荐(0) 编辑
摘要: # 安装 pip install python-pptx from pptx import Presentation from pptx.util import Cm, Pt # 打开ppt prs = Presentation('测试.pptx') # 获取slide幻灯片 for slide i 阅读全文
posted @ 2020-09-04 19:07 不会飞的鲨鱼 阅读(5342) 评论(0) 推荐(0) 编辑
摘要: from docx import Document from docx.enum.text import WD_PARAGRAPH_ALIGNMENT from docx.shared import Pt, RGBColor from docx.oxml.ns import qn doc = Doc 阅读全文
posted @ 2020-09-04 19:06 不会飞的鲨鱼 阅读(2144) 评论(0) 推荐(0) 编辑
摘要: ''' # 安装 pip install python-docx Document: 文档 Paragraph: 段落 Run: 文字块 ''' from docx import Document from docx.shared import Cm # 打开word文档 doc = Documen 阅读全文
posted @ 2020-09-04 19:05 不会飞的鲨鱼 阅读(2013) 评论(0) 推荐(0) 编辑