用PYTHON批量將PDF保存為圖片
2016-05-27 00:45
417 查看
__author__ = 'kong' #!/usr/bin/env python import PythonMagick from PyPDF2 import PdfFileReader for j in range(0,23): print(j) if j<10: oclock="0"+str(j) else: oclock=str(j) pdffile = "C:\Users\kong\Desktop\950hPa\\2006to2011,05,"+oclock+"UTC950.pdf" reader = PdfFileReader(file(pdffile, "rb")) npage = reader.getNumPages() for i in range(0, npage): im = PythonMagick.Image(pdffile + '['+ str(i) +']') im.write(pdffile[0:-4] + '_' + str(i)+ '.png')
Reference:
http://walkerqt.blog.51cto.com/1310630/1411848/
相关文章推荐
- python装饰器前世今生
- python统计文件行数效率对比
- 『Python』 爬取 WooYun 论坛所有漏洞条目的相关信息
- python-文件操作
- Python为什么没有switch/case语句?
- Python程序中的观察者模式结构编写示例
- 详解Python编程中对Monkey Patch猴子补丁开发方式的运用
- python3.2.5 + PyMySQL3 0.5 基本使用方法
- python类中super()和__init__()的区别
- 1、python文件读写练习
- python学习之路-3 初始python数据类型以及文件操作
- python学习之路-2 初识python数据类型
- python学习之路-1 python基础操作
- python学习之路-1 python简介及安装方法
- leetcode(11),Power of Three(python)
- python二进制解析strut.upack的错误unpack requires a string argument of length 4
- Python脚本中写日志的问题
- python学习3
- 关于Python的主(main)函数问题--转
- Python学习笔记-简易抓取网页-2