Skip to content

feat(watermark): add image watermark support#76

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
Anubhav-Mondal:feature/add-image-watermark
May 14, 2026
Merged

feat(watermark): add image watermark support#76
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
Anubhav-Mondal:feature/add-image-watermark

Conversation

@Anubhav-Mondal
Copy link
Copy Markdown
Contributor

Add image watermark support

Closes #75

What changed

  • pdf.service.js: extended addWatermark to accept an optional watermarkImage (PNG or JPG). Uses embedPng/embedJpg with page.drawImage(). Rotation is handled by a private rotateImageBytes helper that pre-bakes the angle onto a canvas before embedding, since pdf-lib has no native rotation parameter for images.

  • Watermark.jsx: added a Text / Image mode toggle. Image mode shows a <Dropzone> for uploading the watermark image. Font size slider is replaced with a scale slider in image mode. Switching modes resets rotation to a sensible default (45° for text, 0° for image).

Why

The tool only supported text watermarks. Image watermarks are essential for branding and corporate document security (logos, stamps, signatures).

How to test

  1. Upload any PDF
  2. Switch to Image mode, drop a PNG or JPG
  3. Adjust opacity, scale, position, rotation, and preview updates live
  4. Download and verify the watermark is baked into the PDF

Screenshots

image
image
image

@netlify
Copy link
Copy Markdown

netlify Bot commented May 9, 2026

👷 Deploy request for quickstpdf pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 121b655

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 9, 2026

@Anubhav-Mondal is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quick-pdf Ready Ready Preview, Comment May 14, 2026 3:56pm

@JhaSourav07
Copy link
Copy Markdown
Owner

@Anubhav-Mondal

Thanks for the amazing contribution.

@JhaSourav07 JhaSourav07 merged commit a0e84f9 into JhaSourav07:main May 14, 2026
3 checks passed
@JhaSourav07 JhaSourav07 added NSOC'26 level3 10 pts - Advanced labels May 14, 2026
@Anubhav-Mondal Anubhav-Mondal deleted the feature/add-image-watermark branch May 15, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level3 10 pts - Advanced NSOC'26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add support for Image/Logo Watermarks

2 participants