当前位置: 首页 > news >正文

哪有做logo的网站网页设计一般用什么软件

哪有做logo的网站,网页设计一般用什么软件,网页设计精选网站,wordpress如何设水印图片由于PDF的文件大多都是只读文件,有时候为了满足可以编辑的需要通常可以将PDF文件直接转换成Word文件进行操作。 看了网络上面的python转换PDF文件为Word的相关文章感觉都比较复杂,并且关于一些图表的使用还要进行特殊的处理。 本篇文章主要讲解关于如何…

由于PDF的文件大多都是只读文件,有时候为了满足可以编辑的需要通常可以将PDF文件直接转换成Word文件进行操作。

看了网络上面的python转换PDF文件为Word的相关文章感觉都比较复杂,并且关于一些图表的使用还要进行特殊的处理。

本篇文章主要讲解关于如何使用python是实现将PDF转换成Word的业务过程,这次没有使用GUI应用的操作。

由于可能存在版本冲突的问题,这里将开发过程中需要使用的python非标准库的版本列举出来。

python内核版本:3.6.8
PyMuPDF版本:1.18.17
pdf2docx版本:0.5.1

可以选择pip的方式对使用到的python非标准库进行安装。

pip install PyMuPDF==1.18.17pip install pdf2docx==0.5.1

完成上述的python依赖库安装以后,将pdf2docx导入到我们的代码块中。

# Importing the Converter class from the pdf2docx module.
from pdf2docx import Converter

然后,编写业务函数的代码块,新建一个pdfToWord函数来处理转换逻辑,主要就几行代码可以实现比较简单。

def pdfToWord(pdf_file_path=None, word_file_path=None):"""It takes a pdf file path and a word file path as input, and converts the pdf file to a word file.:param pdf_file_path: The path to the PDF file you want to convert:param word_file_path: The path to the word file that you want to create"""# Creating a Converter object.converter_ = Converter(pdf_file_path)# The `convert` method takes the path to the word file that you want to create, and the start and end pages of the PDF# file that you want to convert.converter_.convert(word_file_path, start=0, end=None)converter_.close()

最后,使用main函数调用pdfToWord函数可以直接完成文档格式的转换。

# A special variable in Python that evaluates to `True` if the module is being run directly by the Python interpreter, and
# `False` if it has been imported by another module.
if __name__ == '__main__':pdfToWord('D:/test-data-work/test_pdf.pdf', 'D:/test-data-work/test_pdf.docx')# Parsing Page 2: 2/5...Ignore Line "∑" due to overlap
# Ignore Line "∑" due to overlap
# Ignore Line "ç" due to overlap
# Ignore Line "A" due to overlap
# Ignore Line "i =1" due to overlap
# Ignore Line "æ" due to overlap
# Parsing Page 5: 5/5...
# Creating Page 5: 5/5...
# --------------------------------------------------
# Terminated in 3.2503201s.
往期精彩

为了方便,我一口气将20多个python自动化相关的模块记录了下来。

python最好用的能源类可视化图表模块,没有之一!

python如何完成对 Excel文件的解密后读取?

http://www.hkea.cn/news/251629/

相关文章:

  • 诈骗网站怎么做的企业网站seo案例分析
  • 如何做网站接口湖南营销型网站建设
  • 进入兔展网站做PPt软文营销ppt
  • app网站新闻危机公关
  • 东莞关键词优化实力乐云seo南宁seo外包服务商
  • 做网站都是用源码么免费注册个人网站不花钱
  • 建设网站需要两种服务支持官网设计公司
  • 安庆做网站seo建站收费地震
  • 绵阳住房和城市建设局网站官网seo排名优化联系13火星软件
  • 网站开发建设费用关键词异地排名查询
  • 网站建设企业电话广州优化疫情防控举措
  • 重庆模板网站建设百度网站域名注册
  • 安徽建设厅网站地址网络广告推广方式
  • 门户网站内容管理建设方案企业关键词优化推荐
  • 北京网站建设公司飞沐小学生一分钟新闻播报
  • 企业网站建设申请域名seo赚钱
  • 2017网站开发前景百度网盘资源链接入口
  • 平面广告设计主题seo是怎么优化上去
  • 正规网站制作公司哪家好四年级写一小段新闻
  • 济南网站建设安卓版快手seo
  • java开发兼职网站开发线上推广平台
  • 北京网站建设开发公司网站自动收录
  • wordpress最多多少用户seo基础知识
  • 湘潭做网站 去磐石网络b站推出的短视频app哪个好
  • 宿迁做网站的公司有人看片吗免费观看视频
  • 什么人最需要建设网站淘宝运营一般要学多久
  • 海南网站优化东莞免费建站公司
  • 传播型网站建设优势有哪些推广类软文
  • 如何在百度做网站推广赚钱的软件
  • c# 网站开发教程周口网站seo