Platinum Partner

Add A Watermark To A Multi-page PDF (a-la Pragmatic Programmers)

This adds a text watermark to every page of a PDF document, as used by Pragmatic Programmers. Nothing secret here, more of a way to excercise "human" DRM. Used as:


   perl makepdf.pl "John Doe"



use PDF::Reuse;
use PDF::Reuse::Util;
use strict;

my ($name) = @ARGV;

prFile('book_for_someone.pdf');

my $sourcePdf = 'pdf_that_your_designer_made.pdf';
my $greeting = "This book is personalized for " . $name;

my $left = 1;
while ($left) {
   prFont('HO');
   prAdd("0 0 0 rg\n0 g\nf\n");
   prText( 38, 800, $greeting);
   $left = prSinglePage($sourcePdf);   
} 

prEnd;
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}