Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
ImageAiParser
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1b0cfeb8
authored
Aug 14, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面调整
parent
d7cf88b1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
applications/view/system/parser.py
+8
-1
templates/system/parser/detail.html
+5
-6
No files found.
applications/view/system/parser.py
View file @
1b0cfeb8
...
@@ -49,7 +49,14 @@ def detail(id):
...
@@ -49,7 +49,14 @@ def detail(id):
if
path_parts
[
0
]
.
endswith
(
':'
)
and
not
path_parts
[
0
]
.
endswith
(
os
.
sep
):
if
path_parts
[
0
]
.
endswith
(
':'
)
and
not
path_parts
[
0
]
.
endswith
(
os
.
sep
):
path_parts
[
0
]
+=
os
.
sep
path_parts
[
0
]
+=
os
.
sep
data
.
file_path
=
os
.
path
.
join
(
*
path_parts
)
data
.
file_path
=
os
.
path
.
join
(
*
path_parts
)
return
render_template
(
'system/parser/detail.html'
,
data
=
data
)
with
open
(
'./tmp/pdf/4.pdf'
,
'rb'
)
as
file
:
pdf_data
=
file
.
read
()
# 将二进制数据编码为Base64字符串
base64_pdf
=
base64
.
b64encode
(
pdf_data
)
.
decode
(
'utf-8'
)
full_base64_string
=
f
'data:application/pdf;base64,{base64_pdf}'
return
render_template
(
'system/parser/detail.html'
,
data
=
data
,
pdf_base64
=
full_base64_string
)
...
...
templates/system/parser/detail.html
View file @
1b0cfeb8
...
@@ -21,23 +21,22 @@
...
@@ -21,23 +21,22 @@
<td>
<td>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<object
data=
"{{data.file_path}}"
type=
"application/pdf"
width=
"100%"
height=
"100%"
>
<embed
src=
"{{pdf_base64}}"
width=
"100%"
height=
"1000"
type=
"application/pdf"
>
<p><b>
返回内容
</b>
: 该浏览器不支持PDFs
</object>
</div>
</div>
</td>
</td>
</tr>
<tr>
<td>
<td>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
{{data.kimi_ai_parser}}
{{data.kimi_ai_parser}}
</div>
</div>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
</div
>
</div
>
{% include 'system/common/footer.html' %}
{% include 'system/common/footer.html' %}
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