rairo commited on
Commit
d691d98
·
verified ·
1 Parent(s): b7e4bf5

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -7
main.py CHANGED
@@ -616,7 +616,7 @@ def view_videos():
616
 
617
  #download archives endpoint
618
 
619
- # Configure logging to a file
620
 
621
  @app.route('/api/download/story_archive/<story_id>', methods=['GET'])
622
  def download_story_archive(story_id):
@@ -662,11 +662,14 @@ def download_story_archive(story_id):
662
  pdf.add_page()
663
  pdf.set_font("Arial", size=12)
664
 
665
- pdf.multi_cell(0, 10, f"Story ID: {story_id}")
666
- pdf.multi_cell(0, 10, f"Title: {title}")
 
 
 
667
  pdf.ln(10)
668
- pdf.multi_cell(0, 10, "Full Story:")
669
- pdf.multi_cell(0, 10, full_text)
670
 
671
  # Add sections
672
  bucket = storage.bucket()
@@ -676,9 +679,9 @@ def download_story_archive(story_id):
676
 
677
  pdf.add_page()
678
  pdf.set_font("Arial", style='B', size=14)
679
- pdf.multi_cell(0, 10, f"Section {idx + 1}")
680
  pdf.set_font("Arial", size=12)
681
- pdf.multi_cell(0, 10, section_text)
682
 
683
  # Download & embed images
684
  if image_url:
 
616
 
617
  #download archives endpoint
618
 
619
+ # Configure lo)s")
620
 
621
  @app.route('/api/download/story_archive/<story_id>', methods=['GET'])
622
  def download_story_archive(story_id):
 
662
  pdf.add_page()
663
  pdf.set_font("Arial", size=12)
664
 
665
+ # Ensure text fits the page width properly
666
+ max_width = 190 # Keep within A4 width
667
+
668
+ pdf.multi_cell(max_width, 10, f"Story ID: {story_id}")
669
+ pdf.multi_cell(max_width, 10, f"Title: {title}")
670
  pdf.ln(10)
671
+ pdf.multi_cell(max_width, 10, "Full Story:")
672
+ pdf.multi_cell(max_width, 10, full_text)
673
 
674
  # Add sections
675
  bucket = storage.bucket()
 
679
 
680
  pdf.add_page()
681
  pdf.set_font("Arial", style='B', size=14)
682
+ pdf.multi_cell(max_width, 10, f"Section {idx + 1}")
683
  pdf.set_font("Arial", size=12)
684
+ pdf.multi_cell(max_width, 10, section_text)
685
 
686
  # Download & embed images
687
  if image_url: