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
02656f91
authored
2022-06-14 10:50:41 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug f3
1 parent
72c57e42
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
src/apps/doc/management/commands/folder_f3_process.py
src/common/tools/pdf_to_img.py
src/apps/doc/management/commands/folder_f3_process.py
View file @
02656f9
...
...
@@ -141,6 +141,7 @@ class Command(BaseCommand, LoggerMixin):
sheet_name
,
key_field
,
side_field_order
,
src_field_order
=
self
.
field_map
.
get
(
c
)
if
sheet_name
in
wb
.
sheetnames
:
ws
=
wb
.
get_sheet_by_name
(
sheet_name
)
ws
.
append
((
None
,))
else
:
ws
=
wb
.
create_sheet
(
sheet_name
)
...
...
src/common/tools/pdf_to_img.py
View file @
02656f9
...
...
@@ -30,13 +30,17 @@ class PDFBuild:
self
.
path
=
path
def
insert_img
(
self
,
img_path_list
):
name
=
os
.
path
.
split
(
self
.
path
)[
-
1
]
if
os
.
path
.
exists
(
self
.
path
):
pdf
=
fitz
.
Document
(
self
.
path
)
else
:
pdf
=
fitz
.
Document
()
for
img_path
in
img_path_list
:
new_page
=
pdf
.
newPage
()
new_page
.
insertImage
(
new_page
.
rect
,
img_path
)
new_page
.
insertImage
(
new_page
.
rect
,
filename
=
img_path
)
# print(pdf.name) filename or ''
# print(pdf.stream) None
pdf
.
name
=
name
pdf
.
save
(
self
.
path
)
pdf
.
close
()
...
...
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