Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
19ae33d8
Commit
19ae33d8
authored
Sep 26, 2024
by
houlinfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 1. 修复写markdown乱码 2. 更新readme
parent
9cb88954
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
README.md
projects/web_demo/README.md
+1
-1
pdf_ext.py
projects/web_demo/web_demo/api/analysis/pdf_ext.py
+2
-2
No files found.
projects/web_demo/README.md
View file @
19ae33d8
...
...
@@ -36,7 +36,7 @@ pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# 进入程序目录
cd
projects/web_demo/web_demo
# 启动服务
python3 app.py
python3 app.py
或者 python app.py
# 在浏览器访问启动的地址即可访问界面
```
...
...
projects/web_demo/web_demo/api/analysis/pdf_ext.py
View file @
19ae33d8
...
...
@@ -97,7 +97,7 @@ def analysis_pdf_task(pdf_dir, image_dir, pdf_path, is_ocr, analysis_pdf_id):
full_md_content
+=
item
[
"md_content"
]
+
"
\n
"
full_md_name
=
"full.md"
with
open
(
f
"{pdf_dir}/{full_md_name}"
,
"w"
)
as
file
:
with
open
(
f
"{pdf_dir}/{full_md_name}"
,
"w"
,
encoding
=
"utf-8"
)
as
file
:
file
.
write
(
full_md_content
)
with
app
.
app_context
():
full_md_link
=
url_for
(
'analysis.mdview'
,
filename
=
full_md_name
,
as_attachment
=
False
)
...
...
@@ -108,7 +108,7 @@ def analysis_pdf_task(pdf_dir, image_dir, pdf_path, is_ocr, analysis_pdf_id):
for
n
,
md
in
enumerate
(
json
.
loads
(
md_content
)):
md_content
=
md
[
"md_content"
]
md_name
=
f
"{md.get('page_no', n)}.md"
with
open
(
f
"{pdf_dir}/{md_name}"
,
"w"
)
as
file
:
with
open
(
f
"{pdf_dir}/{md_name}"
,
"w"
,
encoding
=
"utf-8"
)
as
file
:
file
.
write
(
md_content
)
md_url
=
url_for
(
'analysis.mdview'
,
filename
=
md_name
,
as_attachment
=
False
)
md_link_list
.
append
(
f
"{md_url}&pdf={pdf_name}"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment