107dc260 by 周伟奇

add f3 folder

1 parent a825541a
...@@ -24,6 +24,23 @@ WH_COUPLE_4 = (100, 300) ...@@ -24,6 +24,23 @@ WH_COUPLE_4 = (100, 300)
24 WH_COUPLE_5 = (100, 200) 24 WH_COUPLE_5 = (100, 200)
25 25
26 26
27 class PDFBuild:
28
29 def __init__(self, path):
30 self.path = path
31
32 def insert_img(self, img_path_list):
33 if os.path.exists(self.path):
34 pdf = fitz.Document(self.path)
35 else:
36 pdf = fitz.Document()
37 for img_path in img_path_list:
38 new_page = pdf.newPage()
39 new_page.insertImage(new_page.rect, img_path)
40 pdf.save(self.path)
41 pdf.close()
42
43
27 class PDFHandler: 44 class PDFHandler:
28 45
29 def __init__(self, path, img_dir_path, document_name=None): 46 def __init__(self, path, img_dir_path, document_name=None):
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!