ABDALLALSWAITI commited on
Commit
6af02b9
·
verified ·
1 Parent(s): 71e5807

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -235,10 +235,16 @@ def convert_html_to_pdf(html_content, aspect_ratio, temp_dir, image_files=None):
235
 
236
  # Save image files to the same directory
237
  if image_files:
 
238
  for filename, img_bytes in image_files.items():
239
  img_path = os.path.join(temp_dir, filename)
240
  with open(img_path, 'wb') as f:
241
  f.write(img_bytes)
 
 
 
 
 
242
 
243
  # Find puppeteer script
244
  possible_paths = [
 
235
 
236
  # Save image files to the same directory
237
  if image_files:
238
+ print(f"Saving {len(image_files)} image(s) to {temp_dir}")
239
  for filename, img_bytes in image_files.items():
240
  img_path = os.path.join(temp_dir, filename)
241
  with open(img_path, 'wb') as f:
242
  f.write(img_bytes)
243
+ print(f" Saved: {filename} ({len(img_bytes)} bytes)")
244
+
245
+ # Debug: Log what's in the temp directory
246
+ dir_contents = os.listdir(temp_dir)
247
+ print(f"Temp directory contents: {dir_contents}")
248
 
249
  # Find puppeteer script
250
  possible_paths = [