Spaces:
Sleeping
Sleeping
Download app.py from aneesqumar/MergePDF: direct link, hf CLI and curl.
- Browser
- Download file 483 Bytes
-
https://huggingface.co/spaces/aneesqumar/MergePDF/resolve/main/app.py
- Command line
-
hf download hf://spaces/aneesqumar/MergePDF/app.py
-
curl -L -o app.py https://huggingface.co/spaces/aneesqumar/MergePDF/resolve/main/app.py
483 Bytes
| import gradio as gr | |
| import subprocess | |
| def merge_pdfs(files): | |
| if not files: | |
| return None | |
| output = "merged.pdf" | |
| cmd = ["pdfunite"] + [f.name for f in files] + [output] | |
| subprocess.run(cmd, check=True) | |
| return output | |
| with gr.Blocks() as demo: | |
| gr.Markdown("# 📄 PDF Merger (Ultra Stable)") | |
| pdfs = gr.File(file_types=[".pdf"], file_count="multiple") | |
| out = gr.File() | |
| btn = gr.Button("Merge") | |
| btn.click(merge_pdfs, pdfs, out) | |
| demo.launch() |