Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
d6a270fd
authored
2020-11-07 16:39:47 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
4c2b01b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
src/apps/doc/views.py
src/apps/doc/views.py
View file @
d6a270f
...
...
@@ -282,8 +282,11 @@ class DocView(GenericView, DocHandler):
pdf_file
=
args
.
get
(
'pdf_file'
)
file_write
(
pdf_file
,
tmp_save_path
)
# if not fitz.open("pdf", pdf_file).isPDF
:
try
:
file
=
fitz
.
Document
(
tmp_save_path
)
except
Exception
as
e
:
raise
self
.
invalid_params
(
msg
=
'invalid params: not a PDF file'
)
else
:
if
not
file
.
isPDF
:
file
.
close
()
raise
self
.
invalid_params
(
msg
=
'invalid params: not a PDF file'
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment