当前位置:网站首页>Simple code to realize PDF to word document
Simple code to realize PDF to word document
2022-07-29 06:18:00 【Programming sail】
Scenario introduction
In the face of this situation , Most of us use online tools , But online tools are mixed , It's hard to meet our needs .
I believe that in the process of daily work and study , There are many times when you need to pdf To word file , That is, from read-only to read-write form . In the face of this situation , Most of us use online professional software or websites , But the software needs to be downloaded , The website also needs to be connected , Are far from hydrolysis, near thirst , Sometimes the effect is not satisfactory .
At this time, we can consider using Python Complete this task , Not only the effect is good, it can be offline , And just a few lines of code .
Code
import os
from pdf2docx import Converter
file_path=os.getcwd()
for file in os.listdir(file_path):
file_last_name=file.split('.')[1]
if file_last_name !='pdf':
continue
else:
pdf_name = file.split('.')[0]
word_name=pdf_name+'.docx'
cv=Converter(file)
cv.convert(word_name)
cv.close()
Instructions
After running the code , Will py All files in the same level directory pdf Turn into word file
example pdf file

Effect after transformation

Software address
There may be a little partner who won't Python, Just want to use this function . So I've packed the software and put it here ~
Gitee Address
GitHub Address
边栏推荐
- Multithreading and concurrency
- 倾角传感器用于通信铁塔、高压电塔长期监测
- Jingwei Qili: OLED character display based on hmep060 (and Fuxi project establishment demonstration)
- mavan中的plugin位置
- #6898 变幻的矩阵 题解
- 基于51单片机的DAC0832波形发生器
- FPGA based: moving target detection (schematic + source code + hardware selection, available)
- Logistic regression - project practice - credit card detection task (Part 2)
- Abstract classes and interfaces
- leetcode刷题笔记 452. Minimum Number of Arrows to Burst Balloons (Medium) 452.用最少数量的箭引爆气球(中等)
猜你喜欢

2022 spring recruit - Hesai technology FPGA technology post (one or two sides, collected from: Digital IC workers and FPGA Explorers)

2022暑初二信息竞赛学习成果分享2

关于时间复杂度的个人看法

shell工具finalShell

从头安装MYSQL(MYSQL安装文档-解压版)

FPGA based: moving target detection (schematic + source code + hardware selection, available)

CS4344国产替代DP4344 192K 双通道 24 位 DA 转换器

Dust and noise monitoring system

EPS32+Platform+Arduino 跑马灯

【软件工程之美 - 专栏笔记】17 | 需求分析到底要分析什么?怎么分析?
随机推荐
Huawei cloud 14 day Hongmeng device development -day3 kernel development
2022暑初二信息竞赛学习成果分享2
Abstract classes and interfaces
Ml6 self study notes
Huawei cloud 14 day Hongmeng device development -day5 drive subsystem development
防爆倾角传感器应用于LNG液化天然气安全作业
【软件工程之美 - 专栏笔记】20 | 如何应对让人头疼的需求变更问题?
给二维表添加时间序列索引
Ml self study notes 5
Hal library learning notes-11 I2C
CV520国产替代Ci521 13.56MHz 非接触式读写器芯片
STM32 MDK(Keil5) Contents mismatch错误总结
一些工具,插件,软件链接分享给大家~
Multithreading and concurrency
抽象类以及接口
2022 spring move - core technology FPGA development post pen test question (original question and experience)
FPGA based: moving target detection (schematic + source code + hardware selection, available)
无符号右移
STM32 串口乱码
Zero basics FPGA (5): counter of sequential logic circuit design (with introduction to breathing lamp experiment and simple combinational logic design)