• United States

Modifying PDF documents on the fly

Feb 16, 20043 mins
Enterprise Applications

* Watermarking PDF content

A colleague asked an interesting question on an e-mail list I belong to. He wanted to know how to print a subscriber’s e-mail address and a time stamp in light grey on each page of a PDF file they download. His reason for wanting to watermark his content in this way was that several issues of a report he publishes had been illegally re-published by an unauthorized European Web site.

My colleague knows that he has a subscriber in that country and there’s strong circumstantial evidence that the subscriber is the source of the “leak,” and so watermarking would make identifying the culprit easier. So after a bit of research I came across the following product that looks very promising.

First let’s explain the idea: A master PDF document is created for each issue and uploaded to a Web site. The subscriber logs on, goes to the download page and retrieves their copy of the master document. But before the PDF file is transferred, the file is modified with watermarking that embeds the user’s ID and other information.

So we’re going to do this server-side and what we need is a tool kit for editing PDF documents. A likely candidate for .Net-based servers is PDFKit.NET from TallComponents (see links below).

PDFkit.NET allows you to split and append pages, scale, rotate and translate multiple pages into a single page (this is called imposition), stamp new content on existing pages, fill and flatten PDF forms, and add, modify and reset security settings.

To achieve our objectives you would copy the master file and use PDFkit.NET to open the copy and retrieve each page by index. A page is represented by a Page class that exposes two layers: an overlay and an underlay.

You can draw on each of these layers by adding shapes to it. PDFKit.NET allows you to draw on each of these layers with a large set of primitive shapes such as line, pie, rectangle, text, image (BMP, JPEG, etc.) and each shape can be located anywhere on the page, rotated by any angle and scaled.

So by calling the correct PDFkit.NET functions you would stamp each page uniquely and set disable printing flag and disable copying and extraction of text and graphics.

Using PDFkit.NET to add a watermark or unique serial number to each copy would be automatic and a reasonably priced solution. PDFkit.NET pricing starts at $499 for a single server.


Mark Gibbs is an author, journalist, and man of mystery. His writing for Network World is widely considered to be vastly underpaid. For more than 30 years, Gibbs has consulted, lectured, and authored numerous articles and books about networking, information technology, and the social and political issues surrounding them. His complete bio can be found at

More from this author