Skip to main content
PRO Only
Pro Feature

This feature is only available in the Pro edition. Upgrade to Pro to access PDF watermarking.

Pro: PDF Watermarking

PDF Watermarking adds custom text watermarks to PDF files before download. Protect your content, discourage unauthorized sharing, and personalize downloads with user-specific information.

Overview​

PDF Watermarking allows you to:

  • Add text watermarks to PDF downloads
  • Personalize with user information (name, email, date)
  • Configure watermark position, color, and opacity
  • Apply to all PDFs or specific products
  • Process watermarks on-the-fly during download

How It Works​

Watermarking Process​

When a user downloads a PDF:

  1. User clicks download button
  2. Plugin intercepts download request
  3. Checks if watermarking is enabled for this product
  4. Creates temporary copy of PDF
  5. Adds watermark with user information
  6. Serves watermarked PDF to user
  7. Deletes temporary file

Dynamic Watermarks​

Watermarks are generated dynamically for each download:

  • User-specific: Each user gets their own watermark
  • Real-time: Generated at download time
  • Personalized: Includes user name, email, date
  • Unique: Different for every download

Requirements​

Server Requirements​

PDF watermarking requires:

  • PHP 7.0+: Minimum PHP version
  • GD Library: For image manipulation
  • Memory: 128MB minimum (256MB recommended)
  • Execution Time: 60 seconds minimum

Checking Requirements​

Verify your server meets requirements:

  1. Go to Pro Edition > PDF Watermarking
  2. Check "Server Requirements" section
  3. Green checkmarks = requirements met
  4. Red X = missing requirement

Installing GD Library​

If GD Library is missing:

cPanel/Plesk:

  • Contact hosting support
  • Request GD Library installation

VPS/Dedicated:

# Ubuntu/Debian
sudo apt-get install php-gd

# CentOS/RHEL
sudo yum install php-gd

# Restart web server
sudo service apache2 restart

Configuration​

Settings Location​

Go to WP Enhanced > Free Download Woo, then click PDF Settings in the sidebar

Enable Watermarking​

  1. Check "Enable PDF watermarking"
  2. Configure watermark settings
  3. Save changes

Watermark Text​

Set the text to display as watermark:

Static Text:

CONFIDENTIAL - DO NOT SHARE

Dynamic Text with Placeholders:

Licensed to {user_name} ({user_email}) on {date}

Available Placeholders:

  • {user_name} - User's full name
  • {user_email} - User's email address
  • {user_id} - WordPress user ID
  • {date} - Download date
  • {time} - Download time
  • {product_name} - Product name
  • {site_name} - Your site name
  • {site_url} - Your site URL

Example Output:

Licensed to John Smith (john@example.com) on 2024-01-15

Watermark Position​

Choose where watermark appears:

  • Top Left
  • Top Center
  • Top Right
  • Middle Left
  • Middle Center
  • Middle Right
  • Bottom Left
  • Bottom Center
  • Bottom Right

Watermark Appearance​

Font Size:

  • 8-72 points
  • Default: 12 points
  • Larger = more visible

Color:

  • RGB color picker
  • Default: Black (#000000)
  • Use contrasting color

Opacity:

  • 0-100%
  • 0% = invisible
  • 100% = fully opaque
  • Default: 50% (semi-transparent)

Rotation:

  • 0-360 degrees
  • 0° = horizontal
  • 45° = diagonal
  • 90° = vertical

Product Selection​

Apply watermarking to:

All PDF Products:

  • Watermark every PDF download
  • Simplest configuration

Specific Products:

  • Select products from dropdown
  • Only watermark selected products
  • Mix watermarked and non-watermarked

Advanced Configuration​

Per-Product Settings​

Set different watermarks per product:

add_filter('somdn_pdf_watermark_text', function($text, $product_id) {
if ($product_id == 123) {
return 'Premium Content - Licensed to {user_name}';
}
return $text;
}, 10, 2);

Conditional Watermarking​

Watermark based on conditions:

add_filter('somdn_enable_pdf_watermark', function($enable, $product_id, $user_id) {
// Don't watermark for VIP users
$user = get_user_by('id', $user_id);
if (in_array('vip', $user->roles)) {
return false;
}
return $enable;
}, 10, 3);

Custom Watermark Styling​

Customize watermark appearance:

add_filter('somdn_pdf_watermark_style', function($style, $product_id) {
$style['font_size'] = 16;
$style['color'] = array(255, 0, 0); // Red
$style['opacity'] = 75;
$style['rotation'] = 45;
return $style;
}, 10, 2);

Watermark Examples​

Basic Protection​

CONFIDENTIAL - DO NOT DISTRIBUTE

Use Case: General content protection

User Attribution​

Licensed to {user_name} - {user_email}

Use Case: Track who downloaded

Date Stamping​

Downloaded on {date} at {time}

Use Case: Time-sensitive content

Full Attribution​

Licensed to {user_name} ({user_email})
Downloaded from {site_name} on {date}
For personal use only - Do not redistribute

Use Case: Maximum protection

Subtle Watermark​

{user_email}

Settings:

  • Font Size: 8pt
  • Opacity: 25%
  • Position: Bottom Right
  • Color: Light Gray

Use Case: Minimal visual impact

Performance Considerations​

Processing Time​

Watermarking adds processing time:

  • Small PDFs (1-10 pages): 1-3 seconds
  • Medium PDFs (10-50 pages): 3-10 seconds
  • Large PDFs (50+ pages): 10-30 seconds

Server Resources​

Memory Usage:

  • 10-50MB per PDF
  • Depends on PDF size and complexity
  • Temporary files cleaned up automatically

CPU Usage:

  • Brief spike during watermarking
  • Returns to normal after completion

Optimization Tips​

Increase PHP Limits:

// In wp-config.php
define('WP_MEMORY_LIMIT', '256M');
ini_set('max_execution_time', 120);

Optimize PDFs:

  • Compress PDFs before upload
  • Reduce image quality in PDFs
  • Remove unnecessary pages

Caching:

  • Watermarked PDFs are not cached
  • Each download generates new watermark
  • Ensures user-specific watermarks

Troubleshooting​

Watermark Not Appearing​

If watermark doesn't show:

  1. ✅ Verify watermarking is enabled
  2. ✅ Check file is actually a PDF
  3. ✅ Verify GD Library is installed
  4. ✅ Check watermark opacity (not 0%)
  5. ✅ Test with different PDF

Download Timeout​

If download times out:

  1. ✅ Increase max_execution_time
  2. ✅ Increase PHP memory_limit
  3. ✅ Reduce PDF file size
  4. ✅ Check server resources
  5. ✅ Contact hosting support

Watermark Unreadable​

If watermark is hard to read:

  1. ✅ Increase font size
  2. ✅ Adjust opacity (higher = more visible)
  3. ✅ Change color for contrast
  4. ✅ Try different position
  5. ✅ Reduce rotation angle

Server Error​

If watermarking causes errors:

  1. ✅ Check PHP error log
  2. ✅ Verify GD Library installed
  3. ✅ Increase memory limit
  4. ✅ Test with simple PDF
  5. ✅ Disable and re-enable feature

Placeholders Not Replacing​

If placeholders show literally:

  1. ✅ Check placeholder syntax: {user_name}
  2. ✅ Verify user is logged in (for user data)
  3. ✅ Check email capture is enabled
  4. ✅ Test with different placeholder
  5. ✅ Look for PHP errors

Security Considerations​

Watermark Effectiveness​

What Watermarks Do:

  • Discourage casual sharing
  • Identify source of leaks
  • Add legal protection
  • Personalize content

What Watermarks Don't Do:

  • Prevent determined pirates
  • Stop screenshot sharing
  • Guarantee security
  • Replace DRM

Additional Protection​

Combine watermarking with:

Download Limits:

  • Limit downloads per user
  • Prevent mass downloading

Login Requirement:

  • Require account to download
  • Track who downloads

Terms of Service:

  • Legal agreement not to share
  • Consequences for violations

DMCA Protection:

  • Register copyright
  • Monitor for unauthorized use
  • Issue takedown notices

Watermark Removal​

Risk:

  • Watermarks can be removed with PDF editing tools
  • Not foolproof protection

Mitigation:

  • Use diagonal watermarks (harder to remove)
  • Multiple watermarks per page
  • Watermark in document margins
  • Combine with other protections

Use Cases​

Digital Products​

Protect digital products:

  • eBooks
  • Guides and tutorials
  • Templates and worksheets
  • Reports and whitepapers

Educational Content​

Protect course materials:

  • Lesson PDFs
  • Study guides
  • Worksheets
  • Certificates

Business Documents​

Protect business content:

  • Proposals and quotes
  • Contracts and agreements
  • Reports and analyses
  • Presentations

Membership Content​

Protect member-only content:

  • Exclusive resources
  • Premium guides
  • Member handbooks
  • Training materials

Best Practices​

Watermark Design​

  • Readable: Use legible font size
  • Visible: Ensure watermark is noticeable
  • Professional: Don't overdo it
  • Informative: Include useful information

User Experience​

  • Fast: Optimize for quick processing
  • Transparent: Inform users about watermarking
  • Fair: Don't punish legitimate users
  • Clear: Explain watermark purpose
  • Terms: Include in terms of service
  • Notice: Inform users of watermarking
  • Rights: Reserve your rights
  • Enforcement: Be prepared to enforce

Performance​

  • Monitor: Watch server resources
  • Optimize: Keep PDFs small
  • Test: Test with various PDF sizes
  • Limits: Set reasonable limits

Developer Hooks​

Filters​

somdn_enable_pdf_watermark Control watermarking per download.

add_filter('somdn_enable_pdf_watermark', function($enable, $product_id, $user_id) {
// Your logic
return $enable;
}, 10, 3);

somdn_pdf_watermark_text Modify watermark text.

add_filter('somdn_pdf_watermark_text', function($text, $product_id) {
// Your logic
return $text;
}, 10, 2);

somdn_pdf_watermark_style Customize watermark appearance.

add_filter('somdn_pdf_watermark_style', function($style, $product_id) {
$style['font_size'] = 14;
$style['color'] = array(0, 0, 255); // Blue
$style['opacity'] = 60;
$style['rotation'] = 0;
$style['position'] = 'bottom-center';
return $style;
}, 10, 2);

somdn_pdf_watermark_placeholders Add custom placeholders.

add_filter('somdn_pdf_watermark_placeholders', function($placeholders, $user_id, $product_id) {
$placeholders['{company}'] = get_user_meta($user_id, 'company', true);
$placeholders['{license_key}'] = get_post_meta($product_id, 'license_key', true);
return $placeholders;
}, 10, 3);

Actions​

somdn_before_pdf_watermark Before watermarking starts.

add_action('somdn_before_pdf_watermark', function($pdf_path, $product_id) {
// Pre-processing
}, 10, 2);

somdn_after_pdf_watermark After watermarking completes.

add_action('somdn_after_pdf_watermark', function($pdf_path, $product_id, $success) {
// Post-processing
}, 10, 3);

Alternatives to Watermarking​

Other Protection Methods​

Password Protection:

  • Encrypt PDFs with passwords
  • More secure than watermarks
  • Less convenient for users

DRM:

  • Digital Rights Management
  • Strongest protection
  • Requires special readers

View-Only:

  • Display PDFs in browser
  • Disable download
  • Use PDF viewer plugins

Expiring Links:

  • Time-limited download links
  • Links expire after X hours
  • Prevents long-term sharing