Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,31 +33,19 @@ def run_turkish():
|
|
| 33 |
|
| 34 |
# Resimler yalnızca show_images True ise gösterilir
|
| 35 |
if st.session_state.show_images:
|
| 36 |
-
# Uygulama başlığı
|
| 37 |
-
st.title("NoteAnalyzerTurkish.pdf Gösterimi")
|
| 38 |
-
|
| 39 |
# PDF dosyasının yolu
|
| 40 |
pdf_path = os.path.join("turkish", "NoteAnalyzerTurkish.pdf")
|
| 41 |
|
| 42 |
-
# PDF
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
pdf_data = pdf_file.read()
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
data=pdf_data,
|
| 51 |
-
file_name="NoteAnalyzerTurkish.pdf",
|
| 52 |
-
mime="application/pdf"
|
| 53 |
-
)
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
unsafe_allow_html=True
|
| 58 |
-
)
|
| 59 |
-
else:
|
| 60 |
-
st.error("PDF dosyası bulunamadı!")
|
| 61 |
|
| 62 |
#akldnaslkdnmllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
|
| 63 |
# Notları yükleme ve işleme işlemleri (Butona basıldıysa çalışır)
|
|
|
|
| 33 |
|
| 34 |
# Resimler yalnızca show_images True ise gösterilir
|
| 35 |
if st.session_state.show_images:
|
|
|
|
|
|
|
|
|
|
| 36 |
# PDF dosyasının yolu
|
| 37 |
pdf_path = os.path.join("turkish", "NoteAnalyzerTurkish.pdf")
|
| 38 |
|
| 39 |
+
# PDF dosyasını base64'e dönüştürme
|
| 40 |
+
with open(pdf_path, "rb") as pdf_file:
|
| 41 |
+
pdf_data = pdf_file.read()
|
| 42 |
+
pdf_base64 = base64.b64encode(pdf_data).decode("utf-8")
|
|
|
|
| 43 |
|
| 44 |
+
# PDF'yi iframe ile gösterme
|
| 45 |
+
st.markdown(f'<iframe src="data:application/pdf;base64,{pdf_base64}" width="700" height="500"></iframe>', unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
# İndirme butonu ekleme
|
| 48 |
+
st.download_button("PDF İndir", data=pdf_data, file_name="NoteAnalyzerTurkish.pdf", mime="application/pdf")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
#akldnaslkdnmllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
|
| 51 |
# Notları yükleme ve işleme işlemleri (Butona basıldıysa çalışır)
|