Answers.Body: <p>Since you are looking at a linux based solution, the two approaches I would recommend are either doing it during document production (tex would do this just fine and there has been recent discussion on tex.se that would be relevant) or in post production. It has been a while but there are several scripts for adding watermakrs to postscript (prior to printing) that could easily be adapted to your use case when paired with pdf2ps and ps2pdf. <a href="https://softwareengineering.stackexchange.com/questions/221093/how-does-customized-executable-generation-work/221097#221097">My answer to this question</a> may also be helpful.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-05T03:15:37.427Z
Answers.Text: Isn't pdfTeX the common solution for generating PDFs from (La)TeX? AFAIK, that doesn't use PS as an intermediate step.
Answers.UserDisplayName: svick
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-05T03:58:52.227Z
Answers.Text: If you are using tex, it has macros to put content on every page, all you would need to do is a couple lines of customization per copy before running pdfTeX.
Answers.UserDisplayName: hildred
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-07T17:25:45.293Z
Answers.Text: As I mentioned, this is actually pretty easy in TeX/LaTeX, but I'd like something that operates on a PDF level because (1) the LaTeX-to-PDF process if pretty slow (the book has hundreds of images, that's why I'm using PDF in the first place) and (2) ideally I'd be able to use this technique on PDFs generated in other ways.
Answers.UserDisplayName: Rod
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-03T22:53:53.163Z
Answers.LastActivityDate: 2014-01-03T22:53:53.163Z
Answers.LastEditDate: 2017-04-12T07:32:01.500Z
Answers.UserDisplayName: hildred
Answers.Body: <p>If Perl works for you, the module PDF::Reuse (CPAN) makes it very easy to read from a static PDF and apply textstamps or watermarks to any page or pages within the document. The examples given in the documentation could be copied and amended to your purpose with even fairly basic Perl skill or skill in another language.</p>
  
  <p><a href="http://search.cpan.org/~larslund/PDF-Reuse-0.35/Reuse.pm" rel="nofollow">http://search.cpan.org/~larslund/PDF-Reuse-0.35/Reuse.pm</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T23:37:30.207Z
Answers.LastActivityDate: 2014-03-07T23:37:30.207Z
Answers.UserDisplayName: jorourke
Answers.Body: <p>There are lots of tools and utilities in the market. Here are some options from which you can choose as per your budget and requirement:</p>
  
  <ol>
  <li><a href="http://www.a-pdf.com/" rel="nofollow">A-Pdf</a> - Paid but trial version available.</li>
  <li><a href="http://www.softpedia.com/get/Office-tools/PDF/Batch-PDF-Watermark.shtml" rel="nofollow">Batch PDF
  Watermark</a>
  -Free</li>
  </ol>
  
  <p>and few more.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-03T15:53:48.927Z
Answers.Text: Thanks @PM. I've encountered A-Pdf before but I don't think it meets my needs. First, it's Windows only (I'd prefer a Linux-based solution) but I could probably live with that. Second, based on the examples and features lists I've been able to find it seems to be geared toward actual watermarks (e.g., stamping the word DRAFT behind the text of every page) rather than inserting footer text. Maybe it's worth a second look though.
Answers.UserDisplayName: Rod
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-03T15:56:45.147Z
Answers.Text: By the way, that Batch PDF Watermark program looks a little iffy. I think it is likely to contain adware if not outright malware.
Answers.UserDisplayName: Rod
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-03T08:00:57.453Z
Answers.LastActivityDate: 2014-01-03T08:18:53.040Z
Answers.LastEditDate: 2014-01-03T08:18:53.040Z
Answers.UserDisplayName: PM.
Answers.Body: <p>Create a watermark pdf which contains the footer using <a href="http://www.imagemagick.org">imagemagick</a>:</p>
  
  <pre><code>convert -background none -geometry +0+0 -fill \#000000 -pointsize 12 label:"From the library of..." -set label '' -page A4 watermark.pdf
  </code></pre>
  
  <p>It creates a simple pdf ( size: A4 ) with the text From the library of... at the bottom left corner. You might change the font, the position of the text, the size of the text...</p>
  
  <p>This watermark.pdf can be added to ( all pages of ) a pdf file using <a href="http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/">pdftk</a>:</p>
  
  <pre><code>pdftk input.pdf stamp watermark.pdf output output.pdf
  </code></pre>
  
  <p>I've used stamp instead of watermark because it overlays on top of the input pdf.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-07T17:19:08.890Z
Answers.Text: Thanks @asalamon74. This looks very promising. I'm away from my desk just now but I'm going to test this out this evening.
Answers.UserDisplayName: Rod
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-10T16:31:13.580Z
Answers.Text: Sorry for the delay (work crisis).  This is pretty much what I was looking for. Thanks!
Answers.UserDisplayName: Rod
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-04T10:56:22.513Z
Answers.LastActivityDate: 2014-01-04T10:56:22.513Z
Answers.UserDisplayName: asalamon74
Body: <p>To discourage readers from uploading it to public file-sharing sites, I'd like to personalize each copy of a PDF document to embed some identifying information to each page.</p>
  
  <p>I'm thinking of something along the lines of adding the name and/or email address of the "authorized" reader (i.e., the "owner", the original buyer, registrant, etc.) to the footer of most pages.  (Maybe prefaced with "From the library of..." or something like that to make it a little more friendly.)</p>
  
  <p>I'm not trying to hide this from the reader. In fact letting the reader know that sharing their copy of the book is also sharing their name or email address is much of the point of the exercise.</p>
  
  <p>It isn't difficult to merge two PDF documents together, so it would be easy to add the identifying information on a single page, but I'd like it to appear on all (or at least most) pages.</p>
  
  <p>This particular book happens to be generated from a LaTeX document. There are LaTeX packages that can be used to customize the page footer, of course, but I'd prefer a solution that would work for an arbitrary PDF document.  (The LaTex-to-PDF process is relatively slow, and I'd like to be able to do this both on-demand and/or in batches.)</p>
  
  <p>This particular book happens to be distributed as a PDF document, but something similiar for other ebook formats could be useful in the future (both for me, and I suspect, others).</p>
  
  <p>I am aware that a moderately savvy reader can probably remove or overwrite the identifying text, and that this is likely to be even easier to do with formats like epub or mobi.  That's OK. I'm not looking for bullet-proof DRM.</p>
  
  <p><strong>TL/DR: Can anyone recommend a utility or process for generating multiple copies of a PDF document, each with a small bit of text added to the footer?</strong></p>
  
  <p>BTW, I believe that <a href="http://37signals.com/">37 Signals</a> did this for one or more of their books, but I've been unable to find any mention of exactly how it is done.</p>
  
  <p>EDIT: I know that a Google search for "PDF Watermark", etc. yields a number of tools for doing this.  The trouble is that there are many such tools, all of them seemingly from small shops, and many of them look to be crappy at best and shady at worst.  Can anyone recommend a specific application or approach?  (My ideal solution would be Linux-based, since the rest of my publishing workflow is Linux based, but I'm sure many readers would be happy to see Windows-only recommendations as well.)</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-03T05:29:37.317Z
Comments.Text: Also, [*Is “soft DRM” a viable option?*](http://ebooks.stackexchange.com/questions/508/is-soft-drm-a-viable-option) asks a distinct but related question.
Comments.UserDisplayName: Rod
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-03T07:12:41.227Z
Comments.Text: Putting it on each page might be too much. I've read a book once which contains a "Licensed to XY <xy@example.com>" footer on every page. It was very disappointing and completely killed the joy of reading. Like breaking a movie in every second minute to show an anti-piracy commercial. I've paid for the book but the author still thinks that I'm a criminal...
Comments.UserDisplayName: palacsint
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-03T13:25:12.147Z
Comments.Text: Please don't. I heartily agree with @palacsint: just imagine the analogue for a paper book, with a your name and address printed on each page. More concretely, I'd not buy such an ebook.
Comments.UserDisplayName: DaG
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-03T13:54:44.993Z
Comments.Text: @palacsint Perhaps mentioning it once on the title page would not turn off so many potential readers (as compared to adding a footer to every page)? Something along the lines of "Custom made for Joe Smith" or the like?
Comments.UserDisplayName: John
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-03T14:30:43.960Z
Comments.Text: @John: That's look fine for me.
Comments.UserDisplayName: palacsint
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-03T15:43:14.867Z
Comments.Text: I think you all raise a fair point, but I don't see a muted small-print line in the footer as significantly more distracting than running chapter headings or page numbers.  I think the impression it creates is largely a question of design and wording.  That said, maybe there's a middle ground, like only adding the text to the first page of each chapter or something like this.
Comments.UserDisplayName: Rod
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-03T15:45:05.440Z
Comments.Text: As a point of clarification, this is a non-fiction reference-like work, if that changes things.  For what it's worth I just pulled a few similar books off my shelf. They all have text in the header and footer of each page. One of them even has a copyright statement at the footer of each page (but it is the kind of book that one might want to might want to photocopy and share small excerpts).
Comments.UserDisplayName: Rod
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-04T17:56:07.880Z
Comments.Text: For certain kinds of publications, footer, headers, running titles are a traditional and sometimes useful feature: they might remind the reader the title of the present chapter and the like. But he definitely doesn't need to be reminded about his own name and address. (As for the copyright on each page, this was demanded by some lawyer, certainly not by a typographer or book designer, wasn't it?)
Comments.UserDisplayName: DaG
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-09T21:55:55.303Z
Comments.Text: @Rod: The book which I've mentioned was a non-fiction book too. Adding the text only to the first page of every chapter looks fine for me.
Comments.UserDisplayName: palacsint
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-08T03:37:30.557Z
Comments.Text: I had a book that did that, but it was nicely done with layers so that you only saw the footer watermark when it was printed.
  (I guess they wanted to discourage printed copy sharing more than filesharing, which makes sense for a small book)
Comments.UserDisplayName: Frames Catherine White
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-27T06:25:36.590Z
Comments.Text: Being 32signals mentioned i think their philosophy on this: we care less about people who would not pay for this product anyway then people who are our costumers. I.e. it is more important to not annoy people who own the copy, and err on this direction, than to prevent every single person from copying your product. By the way bug thumbs up for not doing DRM.
Comments.UserDisplayName: Greg
Tags: <drm><pdf><creation><publishing>
Title: How can I personalize each copy of a PDF to add the reader's name or email address to each page?
UserDisplayName: Rod
ThreadText: # How can I personalize each copy of a PDF to add the reader's name or email address to each page?
  
  (Asked by: username_0 on 2014-01-03)
  
  To discourage readers from uploading it to public file-sharing sites, I'd like to personalize each copy of a PDF document to embed some identifying information to each page.
  
  I'm thinking of something along the lines of adding the name and/or email address of the "authorized" reader (i.e., the "owner", the original buyer, registrant, etc.) to the footer of most pages. (Maybe prefaced with "From the library of..." or something like that to make it a little more friendly.)
  
  I'm not trying to hide this from the reader. In fact letting the reader know that sharing their copy of the book is also sharing their name or email address is much of the point of the exercise.
  
  It isn't difficult to merge two PDF documents together, so it would be easy to add the identifying information on a single page, but I'd like it to appear on all (or at least most) pages.
  
  This particular book happens to be generated from a LaTeX document. There are LaTeX packages that can be used to customize the page footer, of course, but I'd prefer a solution that would work for an arbitrary PDF document. (The LaTex-to-PDF process is relatively slow, and I'd like to be able to do this both on-demand and/or in batches.)
  
  This particular book happens to be distributed as a PDF document, but something similiar for other ebook formats could be useful in the future (both for me, and I suspect, others).
  
  I am aware that a moderately savvy reader can probably remove or overwrite the identifying text, and that this is likely to be even easier to do with formats like epub or mobi. That's OK. I'm not looking for bullet-proof DRM.
  
  **TL/DR: Can anyone recommend a utility or process for generating multiple copies of a PDF document, each with a small bit of text added to the footer?**
  
  BTW, I believe that [37 Signals](http://37signals.com/) did this for one or more of their books, but I've been unable to find any mention of exactly how it is done.
  
  EDIT: I know that a Google search for "PDF Watermark", etc. yields a number of tools for doing this. The trouble is that there are many such tools, all of them seemingly from small shops, and many of them look to be crappy at best and shady at worst. Can anyone recommend a specific application or approach? (My ideal solution would be Linux-based, since the rest of my publishing workflow is Linux based, but I'm sure many readers would be happy to see Windows-only recommendations as well.)
  
  **Tags:** drm, pdf, creation, publishing
  
  > **Comments:**
  > **username_0**: Also, [*Is “soft DRM” a viable option?*](http://ebooks.stackexchange.com/questions/508/is-soft-drm-a-viable-option) asks a distinct but related question.  
  > **username_1**: Putting it on each page might be too much. I've read a book once which contains a "Licensed to XY <xy@example.com>" footer on every page. It was very disappointing and completely killed the joy of reading. Like breaking a movie in every second minute to show an anti-piracy commercial. I've paid for the book but the author still thinks that I'm a criminal...  
  > **username_2**: Please don't. I heartily agree with @username_1: just imagine the analogue for a paper book, with a your name and address printed on each page. More concretely, I'd not buy such an ebook.  
  > **username_3**: @username_1 Perhaps mentioning it once on the title page would not turn off so many potential readers (as compared to adding a footer to every page)? Something along the lines of "Custom made for Joe Smith" or the like?  
  > **username_1**: @username_3: That's look fine for me.  
  > **username_0**: I think you all raise a fair point, but I don't see a muted small-print line in the footer as significantly more distracting than running chapter headings or page numbers.  I think the impression it creates is largely a question of design and wording.  That said, maybe there's a middle ground, like only adding the text to the first page of each chapter or something like this.  
  > **username_0**: As a point of clarification, this is a non-fiction reference-like work, if that changes things.  For what it's worth I just pulled a few similar books off my shelf. They all have text in the header and footer of each page. One of them even has a copyright statement at the footer of each page (but it is the kind of book that one might want to might want to photocopy and share small excerpts).  
  > **username_2**: For certain kinds of publications, footer, headers, running titles are a traditional and sometimes useful feature: they might remind the reader the title of the present chapter and the like. But he definitely doesn't need to be reminded about his own name and address. (As for the copyright on each page, this was demanded by some lawyer, certainly not by a typographer or book designer, wasn't it?)  
  > **username_1**: @username_0: The book which I've mentioned was a non-fiction book too. Adding the text only to the first page of every chapter looks fine for me.  
  > **username_4**: I had a book that did that, but it was nicely done with layers so that you only saw the footer watermark when it was printed. (I guess they wanted to discourage printed copy sharing more than filesharing, which makes sense for a small book)  
  > **username_5**: Being 32signals mentioned i think their philosophy on this: we care less about people who would not pay for this product anyway then people who are our costumers. I.e. it is more important to not annoy people who own the copy, and err on this direction, than to prevent every single person from copying your product. By the way bug thumbs up for not doing DRM.  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_10 on 2014-01-04. Score: 7 | Accepted answer
  
  Create a watermark pdf which contains the footer using [imagemagick](http://www.imagemagick.org):
  
  ```
  convert -background none -geometry +0+0 -fill \#000000 -pointsize 12 label:"From the library of..." -set label '' -page A4 watermark.pdf
  
  ```
  
  It creates a simple pdf ( size: A4 ) with the text From the library of... at the bottom left corner. You might change the font, the position of the text, the size of the text...
  
  This watermark.pdf can be added to ( all pages of ) a pdf file using [pdftk](http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/):
  
  ```
  pdftk input.pdf stamp watermark.pdf output output.pdf
  
  ```
  
  I've used stamp instead of watermark because it overlays on top of the input pdf.
  
  > **Comments:**
  > **username_0**: Thanks @username_10. This looks very promising. I'm away from my desk just now but I'm going to test this out this evening.  
  > **username_0**: Sorry for the delay (work crisis).  This is pretty much what I was looking for. Thanks!  
  
  ---
  
  ### Answer by username_6 on 2014-01-03. Score: 3
  
  Since you are looking at a linux based solution, the two approaches I would recommend are either doing it during document production (tex would do this just fine and there has been recent discussion on tex.se that would be relevant) or in post production. It has been a while but there are several scripts for adding watermakrs to postscript (prior to printing) that could easily be adapted to your use case when paired with pdf2ps and ps2pdf. [My answer to this question](https://softwareengineering.stackexchange.com/questions/221093/how-does-customized-executable-generation-work/221097#221097) may also be helpful.
  
  > **Comments:**
  > **username_7**: Isn't pdfTeX the common solution for generating PDFs from (La)TeX? AFAIK, that doesn't use PS as an intermediate step.  
  > **username_6**: If you are using tex, it has macros to put content on every page, all you would need to do is a couple lines of customization per copy before running pdfTeX.  
  > **username_0**: As I mentioned, this is actually pretty easy in TeX/LaTeX, but I'd like something that operates on a PDF level because (1) the LaTeX-to-PDF process if pretty slow (the book has hundreds of images, that's why I'm using PDF in the first place) and (2) ideally I'd be able to use this technique on PDFs generated in other ways.  
  
  ---
  
  ### Answer by username_8 on 2014-03-07. Score: 2
  
  If Perl works for you, the module PDF::Reuse (CPAN) makes it very easy to read from a static PDF and apply textstamps or watermarks to any page or pages within the document. The examples given in the documentation could be copied and amended to your purpose with even fairly basic Perl skill or skill in another language.
  
  <http://search.cpan.org/~larslund/PDF-Reuse-0.35/Reuse.pm>
  
  
  ---
  
  ### Answer by username_9 on 2014-01-03. Score: 0
  
  There are lots of tools and utilities in the market. Here are some options from which you can choose as per your budget and requirement:
  
  1. [A-Pdf](http://www.a-pdf.com/) - Paid but trial version available.
  2. [Batch PDF
     Watermark](http://www.softpedia.com/get/Office-tools/PDF/Batch-PDF-Watermark.shtml)
     -Free
  
  and few more.
  
  > **Comments:**
  > **username_0**: Thanks @PM. I've encountered A-Pdf before but I don't think it meets my needs. First, it's Windows only (I'd prefer a Linux-based solution) but I could probably live with that. Second, based on the examples and features lists I've been able to find it seems to be geared toward actual watermarks (e.g., stamping the word DRAFT behind the text of every page) rather than inserting footer text. Maybe it's worth a second look though.  
  > **username_0**: By the way, that Batch PDF Watermark program looks a little iffy. I think it is likely to contain adware if not outright malware.  
  
  ---
  
  