02656f91 by 周伟奇

fix bug f3

1 parent 72c57e42
......@@ -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)
......
......@@ -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()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!