@@ -30,8 +30,24 @@ def init_window(self):
30
30
self .scrapy_download .pack (fill = "both" , expand = 1 )
31
31
# Adobe API options.
32
32
self .adobe_api = Frame (self .extract_options , relief = "groove" , borderwidth = 5 )
33
- self .adobe_some_text = Label (self .adobe_api , text = "This is the Adobe options area." )
34
- self .adobe_some_text .pack (fill = "x" , expand = 1 )
33
+ self .adobe_request = Frame (self .adobe_api , relief = "groove" , borderwidth = 3 )
34
+ self .adobe_request .pack (fill = "both" , expand = 1 )
35
+ self .adobe_request_lbl = Label (self .adobe_request , text = "Adobe PDF Extract API" )
36
+ self .adobe_request_lbl .pack (fill = "x" , expand = 1 )
37
+ self .adobe_request_ent_multi_val = StringVar ()
38
+ self .adobe_request_ent_multi = Entry (self .adobe_request , textvariable = self .adobe_request_ent_multi_val )
39
+ self .adobe_request_ent_multi .pack (fill = "x" , expand = 1 , side = "left" )
40
+ self .adobe_request_btn_multi = Button (self .adobe_request , text = "Select Folder" , command = self .adobe_browse_folder )
41
+ self .adobe_request_btn_multi .pack (fill = "x" , expand = 1 , side = "left" )
42
+ self .adobe_request_ent_single_val = StringVar ()
43
+ self .adobe_request_ent_single = Entry (self .adobe_request , textvariable = self .adobe_request_ent_single_val )
44
+ self .adobe_request_ent_single .pack (fill = "x" , expand = 1 , side = "left" )
45
+ self .adobe_request_btn_single = Button (self .adobe_request , text = "Select File" , command = self .adobe_browse_file )
46
+ self .adobe_request_btn_single .pack (fill = "x" , expand = 1 , side = "left" )
47
+ self .adobe_request_btn_send = Button (self .adobe_request , text = "Send Request(s)" )
48
+ self .adobe_request_btn_send .pack (fill = "x" , expand = 1 , side = "bottom" )
49
+ # self.adobe_some_text = Label(self.adobe_api, text="This is the Adobe options area.")
50
+ # self.adobe_some_text.pack(fill="x", expand=1)
35
51
self .adobe_api .pack (fill = "both" , expand = 1 )
36
52
# PyMuPDF options. (Manual/Auto Extraction)
37
53
self .pymupdf_extract = Frame (self .extract_options , relief = "groove" , borderwidth = 5 )
@@ -218,6 +234,30 @@ def toggle_zoom(self):
218
234
self .pdf_page_data = PhotoImage (data = self .data )
219
235
self .pdf_page_img .configure (image = self .pdf_page_data , text = None )
220
236
237
+ def adobe_browse_folder (self ):
238
+ """Browse for a folder and set the Entry field to the chosen folder."""
239
+ pdf_dir = filedialog .askdirectory (title = "PDF Toolbox Document Browser" , initialdir = constants .src_dir )
240
+ self .adobe_request_ent_multi_val .set (pdf_dir )
241
+ self .adobe_request_ent_single_val .set ("" )
242
+
243
+ def adobe_browse_file (self ):
244
+ """Browse for a file and set the Entry field to the chosen file."""
245
+ pdf_file = filedialog .askopenfilename (
246
+ title = "PDF Toolbox Document Browser" ,
247
+ initialdir = constants .src_dir ,
248
+ filetypes = (
249
+ ("PDF Files" , "*.pdf" ),
250
+ ("XPS Files" , "*.*xps" ),
251
+ ("Epub Files" , "*.epub" ),
252
+ ("Fiction Books" , "*.fb2" ),
253
+ ("Comic Books" , "*.cbz" ),
254
+ ("HTML" , "*.htm*" )
255
+ )
256
+ )
257
+ self .adobe_request_ent_single_val .set (pdf_file )
258
+ self .adobe_request_ent_multi_val .set ("" )
259
+
260
+
221
261
# ------------------------------------------------------------------------------
222
262
# Run standalone.
223
263
# ------------------------------------------------------------------------------
0 commit comments