{"id":26550015,"url":"https://github.com/webdev-haseeb/pdf-merger","last_synced_at":"2025-03-22T07:22:55.414Z","repository":{"id":283674861,"uuid":"952530717","full_name":"WebDev-Haseeb/pdf-merger","owner":"WebDev-Haseeb","description":"A modern web application that lets you easily combine multiple PDF files into a single document with an intuitive drag-and-drop interface.","archived":false,"fork":false,"pushed_at":"2025-03-21T14:05:05.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T14:25:12.904Z","etag":null,"topics":["css","design","font-awesome","html","javasc","js","pdf-converter"],"latest_commit_sha":null,"homepage":"https://webdev-haseeb.github.io/pdf-merger/","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebDev-Haseeb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-21T12:40:14.000Z","updated_at":"2025-03-21T14:07:47.000Z","dependencies_parsed_at":"2025-03-21T14:41:55.159Z","dependency_job_id":null,"html_url":"https://github.com/WebDev-Haseeb/pdf-merger","commit_stats":null,"previous_names":["webdev-haseeb/pdf-merger"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDev-Haseeb%2Fpdf-merger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDev-Haseeb%2Fpdf-merger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDev-Haseeb%2Fpdf-merger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDev-Haseeb%2Fpdf-merger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebDev-Haseeb","download_url":"https://codeload.github.com/WebDev-Haseeb/pdf-merger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244920732,"owners_count":20532093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","design","font-awesome","html","javasc","js","pdf-converter"],"created_at":"2025-03-22T07:22:54.640Z","updated_at":"2025-03-22T07:22:55.408Z","avatar_url":"https://github.com/WebDev-Haseeb.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PDF Merger\n\n![PDF Merger App](./Interface.png)\n\nA modern web application that lets you easily combine multiple PDF files into a single document with an intuitive drag-and-drop interface.\n\n## Features\n\n- **Merge Multiple PDFs**: Combine up to 3 PDF files into a single document\n- **Drag \u0026 Drop Interface**: Easy file selection with intuitive drag-and-drop functionality\n- **File Reordering**: Arrange your PDFs in any order with simple up/down controls\n- **Client-Side Processing**: All PDF processing happens in your browser - files never leave your computer for maximum privacy\n- **Responsive Design**: Works seamlessly across desktop and mobile devices\n- **Real-Time Feedback**: Informative notifications provide clear guidance and error messages\n\n## Technologies Used\n\n- **Frontend**: HTML5, CSS3, JavaScript (ES6+)\n- **PDF Processing**: [PDF-lib.js](https://pdf-lib.js.org/) for client-side PDF manipulation\n- **UI Components**: [Font Awesome](https://fontawesome.com/) for icons\n- **Fonts**: Google Fonts (Poppins)\n\n## Live Demo\n\nTry the PDF Merger here: [Live Demo](https://webdev-haseeb.github.io/pdf-merger/)\n\n## How It Works\n\n1. **Select Files**: Either drag-and-drop your PDF files onto the designated area or click \"Select Files\" to choose them manually\n2. **Arrange Order**: Use the up/down arrows to arrange the files in your preferred order\n3. **Merge PDFs**: Click the \"Merge PDFs\" button to combine the files\n4. **Download**: Once processing is complete, click \"Download PDF\" to save your merged document\n\n## Technical Details\n\n### PDF Processing Logic\n\nThe application uses PDF-lib.js to handle all PDF operations entirely in the browser:\n\n```javascript\n// Create a new PDF document\nconst mergedPdf = await PDFDocument.create();\n\n// For each PDF file...\nfor (const file of selectedFiles) {\n  // Read file as ArrayBuffer\n  const fileArrayBuffer = await readFileAsArrayBuffer(file);\n  \n  // Load PDF document\n  const pdfDoc = await PDFDocument.load(fileArrayBuffer);\n  \n  // Copy all pages to the merged document\n  const pages = await mergedPdf.copyPages(pdfDoc, pdfDoc.getPageIndices());\n  \n  // Add each page to our merged PDF\n  for (const page of pages) {\n    mergedPdf.addPage(page);\n  }\n}\n\n// Save and create download link\nconst mergedPdfBytes = await mergedPdf.save();\n```\n\n### Key Features\n\n- **Client-Side Processing**: All PDF merging is done in the browser, ensuring your files never leave your device\n- **File Validation**: Checks that only valid PDF files are processed\n- **Error Handling**: Comprehensive error management for corrupted or password-protected PDFs\n- **Custom Notifications**: User-friendly notification system with success/error states and auto-dismissal\n\n## Browser Compatibility\n\n- Chrome (latest)\n- Firefox (latest)\n- Safari (latest)\n- Edge (latest)\n- Opera (latest)\n\n## Installation for Development\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/WebDev-Haseeb/pdf-merger.git\n   ```\n\n2. Navigate to the project directory:\n   ```\n   cd pdf-merger\n   ```\n\n3. Open `index.html` in your browser or set up a local server:\n   ```\n   # Using Python 3\n   python -m http.server 8000\n   \n   # Using Node.js with http-server\n   npx http-server\n   ```\n\n## Project Structure\n\n```\n├── index.html        # Main HTML structure\n├── styles.css        # Styling and responsive design\n├── script.js         # Application logic and PDF processing\n└── favicon.svg       # App icon\n```\n\n## Limitations\n\n- Currently limited to merging 3 PDF files at a time for optimal performance\n- Does not support password-protected PDF files\n- No page selection feature (merges all pages)\n\n## Planned Features\n\n- Increase the file limit beyond 3 PDFs\n- Add page selection options for each PDF\n- Preview functionality for PDFs before merging\n- Support for password-protected PDFs\n- PDF compression options\n- Dark/light theme toggle\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Credits\n\n- [PDF-lib.js](https://pdf-lib.js.org/) for the PDF manipulation tools\n- [Font Awesome](https://fontawesome.com/) for the icons\n\n## Contact\n\nM. Haseeb Amjad \n\nProject Link: [https://webdev-haseeb.github.io/pdf-merger/](https://webdev-haseeb.github.io/pdf-merger/)\n\n---\n\nCreated with ❤️ by Haseeb © 2025","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdev-haseeb%2Fpdf-merger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdev-haseeb%2Fpdf-merger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdev-haseeb%2Fpdf-merger/lists"}