This project is a simple web application that allows users to upload and merge multiple PDF files into a single PDF. The application is built using Node.js, Express.js, and the pdf-merger-js library, with a user-friendly frontend powered by HTML and Bootstrap.
- Upload multiple PDF files.
- Dynamically merge PDFs into a single file.
- Download the merged PDF directly from the browser.
- Responsive UI using Bootstrap.
Before running the project, ensure you have the following installed:
-
- git clone https://github.com/your-username/pdf-merger.git
- cd pdf-merger
-
- npm install
-
. ├── public/ ├── templates/ │ └── PDF.html ├── uploads/ ├── merge.js ├── server1.js ├── README.md ├── package.json └── package-lock.json
- uploads/ (for temporary file storage)
- public/ (for storing the merged PDF)
- node server1.js
- Select multiple PDF files (no file limit).
- Click the Submit button.
- The merged PDF will be available for download at: http://localhost:3000/static/merged.pdf
merge.js Handles the PDF merging logic using the pdf-merger-js library. The function dynamically adds PDFs and saves the merged file to the public/ directory.
Express.js server: Manages routes and file uploads using multer.
- Serves the HTML form.
- /merge: Processes uploaded PDFs and merges them.
- Static files: Hosts the merged PDF for download in the public/ directory.
- A simple, responsive HTML form built with Bootstrap to allow users to upload files and trigger the merge proces
- Express: Web framework for Node.js.
- Multer: Middleware for handling multipart/form-data, used for file uploads.
- PDF Merger JS: Library for merging PDF files.
- Bootstrap: Frontend framework for styling.
Uploaded files remain in the uploads/ directory after merging.