From 99f42607572cffd939e0b6faf2810daa39ee93ce Mon Sep 17 00:00:00 2001 From: Leif <4603009@qq.com> Date: Sat, 22 Oct 2022 23:55:03 +0800 Subject: [PATCH] Update pdf2word.py --- ppstructure/pdf2word/README.md | 11 +++++++---- ppstructure/pdf2word/pdf2word.py | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ppstructure/pdf2word/README.md b/ppstructure/pdf2word/README.md index 11bfec8ab..93023ecde 100644 --- a/ppstructure/pdf2word/README.md +++ b/ppstructure/pdf2word/README.md @@ -1,6 +1,6 @@ # PDF2Word -PDF2Word是PaddleOCR社区开发者 [whjdark](https://github.com/whjdark) 基于PP-StructureV2版面分析与恢复模型实现的PDF转换Word应用程序,提供可直接安装的exe应用程序,**方便Windows用户离线、免环境配置运行** +PDF2Word是PaddleOCR社区开发者 [whjdark](https://github.com/whjdark) 基于PP-StructureV2版面分析与恢复模型实现的PDF转换Word应用程序,提供可直接安装的exe应用程序,**方便Windows用户免环境配置运行** ## 1.使用 @@ -20,18 +20,20 @@ PDF2Word是PaddleOCR社区开发者 [whjdark](https://github.com/whjdark) 基于 > - 初次安装程序根据不同设备需要等待1-2分钟不等 > - 使用Office与WPS打开的Word结果会出现不同,推荐以Office为准 > - 本程序使用 [QPT](https://github.com/QPT-Family/QPT) 进行应用程序打包,感谢 [GT-ZhangAcer](https://github.com/GT-ZhangAcer) 对打包过程的支持 +> - 应用程序不支持盗版Windows系统,若在安装过程中出现报错或缺少依赖,推荐直接使用 `paddleocr` whl包应用PDF2Word功能,详情可查看[链接](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/ppstructure/docs/quickstart.md) ### 脚本启动界面 -首次运行需要将切换路径到 `/ppstructure/pdf2word` ,然后运行代码 +首次运行需要将切换路径到PaddleOCR文件目录 ,然后运行代码 ``` +cd ./ppstructure/pdf2word python pdf2word.py ``` ### PaddleOCR whl包 -针对Linux、Mac用户或已经拥有Python环境的用户,**推荐安装 `paddleocr` whl包直接应用版面恢复功能**,详情可查看[链接](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/ppstructure/docs/quickstart.md) +针对Linux、Mac用户或已经拥有Python环境的用户,**推荐安装 `paddleocr` whl包直接应用PDF2Word功能**,详情可查看[链接](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/ppstructure/docs/quickstart.md) @@ -42,9 +44,10 @@ python pdf2word.py
+ ## 3.版本说明 -v0.2版:新加入PDF解析功能,仅提供full版本,打包了所有依赖包与模型文件,尽可能避免安装失败问题 +v0.2版:新加入PDF解析功能,仅提供full版本,打包了所有依赖包与模型文件,尽可能避免安装失败问题。若仍然安装失败,推荐使用 `paddleocr` whl包 v0.1版:最初版本,分为3个版本: diff --git a/ppstructure/pdf2word/pdf2word.py b/ppstructure/pdf2word/pdf2word.py index a287fb248..735fa5350 100644 --- a/ppstructure/pdf2word/pdf2word.py +++ b/ppstructure/pdf2word/pdf2word.py @@ -213,8 +213,8 @@ class Worker(QThread): class APP_Image2Doc(QWidget): def __init__(self): super().__init__() - self.setFixedHeight(100) - self.setFixedWidth(420) + # self.setFixedHeight(100) + # self.setFixedWidth(520) # settings self.imagePaths = [] @@ -481,7 +481,7 @@ class APP_Image2Doc(QWidget): def handleThreadException(self, message): self._thread.quit() - QMessageBox.information(self, message) + QMessageBox.information(self, 'Error', message) def main():