awacke1 commited on
Commit
07d804e
·
verified ·
1 Parent(s): fbe4960

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -29
app.py CHANGED
@@ -600,36 +600,44 @@ with col2:
600
 
601
  # Library Demos
602
  st.subheader("Library Demos")
603
- if st.button("Run PDF Library Demos"):
604
- with st.spinner("Running demos..."):
605
- # Create tabs for each demo
606
- demo_tabs = st.tabs(["PikePDF", "FPDF", "PyMuPDF", "Image Demo"])
607
-
608
- with demo_tabs[0]:
609
- # pikepdf demo
610
- pike_pdf = demo_pikepdf()
611
- st.download_button("Download pikepdf Demo", pike_pdf, "pikepdf_demo.pdf")
612
- st.write("PikePDF demo created successfully!")
613
- st.info("This PDF contains the multilevel markdown outline in a two-column layout.")
614
-
615
- with demo_tabs[1]:
616
- # fpdf demo
617
- fpdf_pdf = demo_fpdf()
618
- st.download_button("Download fpdf Demo", fpdf_pdf, "fpdf_demo.pdf")
619
- st.write("FPDF demo created successfully!")
620
- st.info("This PDF contains the multilevel markdown outline in a two-column layout.")
621
-
622
- with demo_tabs[2]:
623
- # pymupdf demo
624
- pymupdf_pdf = demo_pymupdf()
625
- st.download_button("Download pymupdf Demo", pymupdf_pdf, "pymupdf_demo.pdf")
626
- st.write("PyMuPDF demo created successfully!")
627
- st.info("This PDF contains the multilevel markdown outline in a two-column layout.")
 
 
 
 
 
628
 
629
- with demo_tabs[3]:
630
- # Image demo
631
- img_data = demo_image_capture()
632
- st.image(img_data, caption="Demo Image (Camera simulation)")
 
 
 
633
 
634
  # Main PDF Generation
635
  st.subheader("Main Outline PDF")
 
600
 
601
  # Library Demos
602
  st.subheader("Library Demos")
603
+
604
+ # PikePDF demo
605
+ if st.button("Generate PikePDF Demo"):
606
+ with st.spinner("Generating PikePDF demo..."):
607
+ pike_pdf = demo_pikepdf()
608
+ st.download_button("Download PikePDF Demo", pike_pdf, "pikepdf_demo.pdf")
609
+ st.success("PikePDF demo created successfully!")
610
+ st.info("This PDF contains the multilevel markdown outline in a two-column layout.")
611
+
612
+ # FPDF demo
613
+ if st.button("Generate FPDF Demo"):
614
+ with st.spinner("Generating FPDF demo..."):
615
+ fpdf_pdf = demo_fpdf()
616
+ st.download_button("Download FPDF Demo", fpdf_pdf, "fpdf_demo.pdf")
617
+ st.success("FPDF demo created successfully!")
618
+ st.info("This PDF contains the multilevel markdown outline in a two-column layout.")
619
+
620
+ # PyMuPDF demo
621
+ if st.button("Generate PyMuPDF Demo"):
622
+ with st.spinner("Generating PyMuPDF demo..."):
623
+ pymupdf_pdf = demo_pymupdf()
624
+ st.download_button("Download PyMuPDF Demo", pymupdf_pdf, "pymupdf_demo.pdf")
625
+ st.success("PyMuPDF demo created successfully!")
626
+ st.info("This PDF contains the multilevel markdown outline in a two-column layout.")
627
+
628
+ # Image demo
629
+ if st.button("Generate Demo Image"):
630
+ with st.spinner("Generating demo image..."):
631
+ img_data = demo_image_capture()
632
+ st.image(img_data, caption="Demo Image (Camera simulation)")
633
 
634
+ # Add download button for the image
635
+ st.download_button(
636
+ label="Download Image",
637
+ data=img_data,
638
+ file_name="demo_image.jpg",
639
+ mime="image/jpeg"
640
+ )
641
 
642
  # Main PDF Generation
643
  st.subheader("Main Outline PDF")