I'd like to add an invisible watermark to each PDF document that I produce so that in case it leaks, I know where it leaked from. Anyone knows what would a good way for an invisible watermark be in a PDF document and how to add one?
8 Answers
Here a funny idea: Just place some watermark/copyright text on top or below of a dot or other punctuation mark. It is invisible for the naked eye if it uses the same color as the text but can be extracted using copy and paste. You can also give it a dark gray color, so you still have a chance to read it on screen.
Here some principal solution:
\documentclass{article}
\usepackage{graphicx}
\usepackage{xcolor}
\newcommand\watermark[1]{%
#1%
\sbox0{#1}%
\llap{%
\makebox[\wd0][c]{% hor. centering
\raisebox{.5\ht0}{% approx. vert. centering
\csname Gin@isotrue\endcsname% = "keepaspectratio"
\resizebox*{.8\ht0}{.8\ht0}{% Scale down (the height is also used for the width to avoid the surrounding spaces)
\parbox{10em}{% Allow line breaks
\color{black!90}%
This PDF was created by John Doe for Jane Doe.
}%
}}}}%
}
\begin{document}
Text text text.
Text text text\watermark.
\end{document}
The dot will then look like this: (note the hard to see text)
-
9
-
1
-
...and some easy way to keep up with version numbering or hashes in such dots? Perhaps to use many dots :)– hhhFeb 14, 2012 at 16:56
-
...I have 16 times zoom in Xpdf in Ubuntu, cannot still see anything. Really working? Nice, I can only see something when I change the font to white but if I ended up into a situation to prove that a copyright notice is written on the dot -- I would be a bit skeptical -- this may get corrupted somehow to become unreadable?– hhhFeb 14, 2012 at 17:07
-
@hhh: No, there is no automatic way to add it to all dots. This answer is about the principle solution. Adding version numbering is a question of its own. I can see the message well using Adobe Acrobat Reader and you can also mark and copy it as text. Because it is text, just smaller than usual, it will not be corrupted. Feb 14, 2012 at 19:49
How about embedding it in an image with steganography, most of the image manipulation libraries such as the GD library have routines available or you can run copies individually and use TikZ!
The message is encrypted in the yellow dots! Some color printers still do it see printer steganography
-
4+1 Steganography is very good if you want to keep the watermark a secret. You can even use it with cryptography/digital signature. May 24, 2011 at 19:37
-
-
2@xport Anything is possible with the right software, but you need to rewrite the printer drivers and possibly more. Jun 22, 2011 at 10:51
With the new version (v2.2 - still in CTAN upload process, but should be available soon) of pdfcomment
you could use an 'invisible' PDF tooltip.
\documentclass{article}
\usepackage{marginnote}
\usepackage[author={Peteris Krumins}]{pdfcomment}
\begin{document}
This\marginnote{\pdftooltip{\rule{0pt}{0.5cm}\rule{0.5cm}{0pt}}{handed over to:\textCR Peteris Krumins}} is just a test sentence.
\end{document}
As soon as you hover over the 0.5cm/0.5cm rectancle in the margin the tooltip pops up. Of course you can put the tooltip in the header/footer or whereever you want.
Easy way to achieve this, is to intentionally put some carefully placed typos (or punctuation, any sort of slight modification), of no real consequence to the document, prior to issuing it to the respective party, ensuring that you keep a ledger of what changes were made. When the leaked document is identified, cross-reference it with your ledger, then (depending on the nature of your work) call your lawyer and instruct him/her to issue a C&D, or instruct your assets to act accordingly.
Here is a somewhat academic idea: encode the watermark in the spacing of words or even letters. I don't know a package to support this, though. The obvious benefit is that this encoding survives printing the document before passing it on.
Addendum: A variation of this is to individualize a document by tweaking the textwidths of some (or all) paragraphs ever so slightly. That will result in different line breaking and spacing decisions. This would not qualify as an encoding but as long as you know which version was given to whom you would know who leaked a document.
I did some experiments that suggest that very small variations to the text width are invisible to the eye but lead to the desired variations of paragraph layout.
-
Any space encoding large enough so it can reliable read back from a print-out will disturb the overall appearance. Also I don't think this is implementable in TeX (within a generously reasonable amount of effort). May 24, 2011 at 15:22
-
5How about this: documents could be individualized by tweaking the textwidths of some (or all) paragraphs ever so slightly. That will result in different line breaking and spacing decisions. This would not qualify as an encoding but as long as you know which version was given to whom you would know who leaked a document. May 24, 2011 at 16:50
If you're looking to track the document itself, it might not be a bad idea to include a serial number or something so that you can track it in printed and photocopied copies...
Any text can be copied & pasted into a text editor, thus losing all special markings. Random and unique changes in the choice and order of words would seem to be the only sure-fire way of tracing leaks.
-
Welcome to TeX.SX I don't think that this was what the OP had in mind when asking about
invisible watermarks
. You should elaborate on your post, improving and showing that it would be a solution, otherwise it's at best unclear at the moment and at worst no solution at all.– user31729Dec 3, 2014 at 20:59 -
It depends on what the OP is really asking for. Is it "invisible watermarks"? Or is it "How do I trace leaks"? I interpret "invisible watermarks" as merely a means to an end, which is: how do I find out who leaked a copy of my document? What I am proposing is to make each copy of the document traceable by inserting an unnoticeable, yet unique pattern of words in a specific part of the document. Make a note of which version was received by each individual on the distribution list.– PierreMay 9, 2017 at 14:29
-
Then, when OP notices a leaked copy of his document, he simply goes to the section of the document with the unique word pattern, compares it to each copy of the document that was doctored differently, and identifies the individual who received that specific version.– PierreMay 9, 2017 at 14:34
@MartinScharrer's idea is very nice.
I'll add a few more ideas (which also should be rather easy to put into practice) without providing the real implementation:
Make the text invisible, by coloring it white on white background (or $anycolor on $anycolor background).
Make the text invisible by placing it on a black line (fontsize small enough to not overflow the line, or line thick enough to let the text disappear).
Use 'text rendering mode 3' (== "don't strike and don't fill the character shapes") to write the text.
Create your own very simple font (for example with the help of FontForge). It only needs to contain all the ASCII characters (or even less: only those characters you want to use -- maybe only numbers?), but each character's shape ("glyph"), including the 'blank'/'space' one, should be the same and look very harmless and innocent, for example a black square. You could load this font even into applications like LibreOffice: you type a text when this font is active, and what appears on screen, in print or in exported PDFs are only black squares. However, from the PDF the text can still be marked and copied or converted to text. If you adjust the font's character widths correctly, the black squares will even form long black lines.
:-(