赞
踩
| 通过Python的pdfplumber库将pdf转为图片 |
|---|
| 空空star的主页 |
大家好,我是空空star,本篇给大家分享一下
《通过Python的pdfplumber库将pdf转为图片》。
pdfplumber是一个用于从PDF文档中提取文本和表格数据的Python库。它可以帮助用户轻松地从PDF文件中提取有用的信息,例如表格、文本、元数据等。pdfplumber库的特点包括:简单易用、速度快、支持多种PDF文件格式、支持从多个页面中提取数据等。pdfplumber库还提供了一些方便的方法来处理提取的数据,例如排序、过滤和格式化等。它是一个非常有用的工具,特别是在需要从大量PDF文件中提取数据时。
pip install pdfplumber
pip show pdfplumber
Name: pdfplumber
Version: 0.9.0
Summary: Plumb a PDF for detailed information about each char, rectangle, and line.
Home-page: https://github.com/jsvine/pdfplumber
Author: Jeremy Singer-Vine
Author-email: jsvine@gmail.com
License:
Requires: pdfminer.six, Pillow, Wand
Required-by:
import pdfplumber
local = '/Users/kkstar/Downloads/'
with pdfplumber.open(local+'demo.pdf') as pdf:
for i, page in enumerate(pdf.pages):
img = page.to_image()
img.save(local+f"page_{i+1}.png")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。