alexkueck commited on
Commit
a29d4ec
1 Parent(s): 2a31549

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -202,8 +202,8 @@ def clear_all(history, uploaded_file_paths, chats):
202
  pdf_writer = PdfWriter()
203
  pdf_reader = PdfReader(memoryFile)
204
  # Gib das PDF-Objekt an PdfFileWriter weiter
205
- for page in range(pdf_reader.getNumPages()):
206
- pdf_writer.addPage(pdf_reader.getPage(page))
207
  # Speichere das PDF-Objekt in einer neuen Datei
208
  with open(file_path_download, "wb") as fp:
209
  pdf_writer.write(fp)
 
202
  pdf_writer = PdfWriter()
203
  pdf_reader = PdfReader(memoryFile)
204
  # Gib das PDF-Objekt an PdfFileWriter weiter
205
+ for page in range(len(pdf_reader.pages)):
206
+ pdf_writer.addPage(pdf_reader.pages[page])
207
  # Speichere das PDF-Objekt in einer neuen Datei
208
  with open(file_path_download, "wb") as fp:
209
  pdf_writer.write(fp)