{"id":27048583,"url":"https://github.com/sigmakib2/express-pdf-watermark-api","last_synced_at":"2026-04-07T08:31:42.491Z","repository":{"id":286138212,"uuid":"960487884","full_name":"Sigmakib2/express-pdf-watermark-api","owner":"Sigmakib2","description":"A simple Express.js API for embedding watermarks on PDF files using pdf-lib and multer. This project demonstrates how to apply forensic watermarks with user details (or unique identifiers) to each page of a PDF, helping deter unauthorized distribution while maintaining user privacy.","archived":false,"fork":false,"pushed_at":"2025-04-04T14:33:52.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T15:32:21.288Z","etag":null,"topics":["anti-piracy","api","digital-watermarking","document-security","expressjs","file-upload","javascript","multer","nodejs","pdf-lib","pdf-processing","pdf-watermark"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Sigmakib2.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-04-04T14:17:47.000Z","updated_at":"2025-04-04T14:38:33.000Z","dependencies_parsed_at":"2025-04-04T15:43:17.857Z","dependency_job_id":null,"html_url":"https://github.com/Sigmakib2/express-pdf-watermark-api","commit_stats":null,"previous_names":["sigmakib2/express-pdf-watermark-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sigmakib2%2Fexpress-pdf-watermark-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sigmakib2%2Fexpress-pdf-watermark-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sigmakib2%2Fexpress-pdf-watermark-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sigmakib2%2Fexpress-pdf-watermark-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sigmakib2","download_url":"https://codeload.github.com/Sigmakib2/express-pdf-watermark-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299851,"owners_count":20916193,"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":["anti-piracy","api","digital-watermarking","document-security","expressjs","file-upload","javascript","multer","nodejs","pdf-lib","pdf-processing","pdf-watermark"],"created_at":"2025-04-05T07:15:17.123Z","updated_at":"2026-04-07T08:31:42.424Z","avatar_url":"https://github.com/Sigmakib2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express PDF Watermark API\n\nA simple Express.js API for embedding watermarks on PDF files using [pdf-lib](https://pdf-lib.js.org/) and [Multer](https://github.com/expressjs/multer). This project demonstrates how to apply forensic watermarks with user details (or unique identifiers) to each page of a PDF, helping deter unauthorized distribution while maintaining user privacy.\n\n## Features\n\n- **PDF Upload:** Accepts PDF files through a REST API endpoint.\n- **Dynamic Watermarking:** Applies a customizable watermark on every page of the uploaded PDF.\n- **User Data Integration:** Incorporates user details such as name, email, phone, and IP into the watermark text.\n- **Simple \u0026 Extendable:** Built with Express.js, making it easy to integrate or extend for your needs.\n\n## Prerequisites\n\n- [Node.js](https://nodejs.org/) (v12 or later)\n- [npm](https://www.npmjs.com/)\n\n## Installation\n\nFollow these step-by-step instructions to get the project running on your local machine:\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/yourusername/express-pdf-watermark-api.git\n   cd express-pdf-watermark-api\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   npm install\n   ```\n\n3. **Project Structure:**\n\n   - `server.js` – The main Express server file containing the watermarking API endpoint.\n   - `package.json` – Contains project metadata and dependencies.\n\n## Usage\n\n### Running the Server\n\nStart the Express server by running:\n\n```bash\nnode server.js\n```\n\nBy default, the server listens on port `3000`. You should see a message similar to:\n\n```\nServer started on port 3000\n```\n\n### Testing the API with Postman\n\nTo test the watermark API endpoint using Postman:\n\n1. **Create a New Request:**\n   - Set the HTTP method to `POST`.\n   - Enter the URL: `http://localhost:3000/watermark`.\n\n2. **Configure the Request Body:**\n   - Click on the **Body** tab.\n   - Select **form-data**.\n   - Add the following keys:\n     - **pdf:** Change the type to **File** and select a PDF file from your computer.\n     - **name:** Enter a sample name (e.g., `John Doe`).\n     - **email:** Enter a sample email (e.g., `john@example.com`).\n     - **phone:** Enter a sample phone number (e.g., `1234567890`).\n     - **ip:** Enter a sample IP address (e.g., `192.168.1.1`).\n\n3. **Send the Request:**\n   - Click the **Send** button.\n   - The API processes the PDF and returns the watermarked PDF file.\n   - You can use the **Save Response** option to download and view the watermarked PDF.\n\n## Customization\n\nYou can modify the watermark's content and style by editing the code in `server.js`. For example, you might change the text formatting, position, rotation angle, or opacity to suit your needs. If you prefer not to expose full personal data, consider using a unique transaction identifier instead.\n\n## Contributing\n\nContributions, bug reports, and feature requests are welcome! Feel free to open issues or submit pull requests.\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Disclaimer\n\nEmbedding personal data directly into documents may have privacy implications. Evaluate your approach and consider using less intrusive methods (such as unique transaction IDs) if privacy is a major concern.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigmakib2%2Fexpress-pdf-watermark-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigmakib2%2Fexpress-pdf-watermark-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigmakib2%2Fexpress-pdf-watermark-api/lists"}