13

is it possible to get watermark text, which is not copyable in PDF? it bothers when doing proofreadings. I mean something like uncopyable line numbers How to make text copy in PDF previewers ignore lineno line numbers?

here is a minimum example

\documentclass[11pt,draft]{article}
\usepackage[a4paper]{geometry}
\usepackage{fontspec}
    \setmainfont{Linux Libertine}
\usepackage{polyglossia}
    \setmainlanguage{czech}
\usepackage{draftwatermark}\SetWatermarkLightness{0.9}\SetWatermarkText{blabla}

\begin{document}

ddd

\end{document}
Ashrak
  • 539

1 Answers1

12

Maybe the accsupp package, which allows the watermark to appear on the page, but the "ActualText" internal to the pdf to be different (in this case, removed).

\documentclass[11pt,draft]{article}
\usepackage[a4paper]{geometry}
%\usepackage{fontspec}
%    \setmainfont{Linux Libertine}
%\usepackage{polyglossia}
%    \setmainlanguage{czech}
\usepackage{draftwatermark}\SetWatermarkLightness{0.9}\SetWatermarkText{%
\BeginAccSupp{method=escape,ActualText={}}blahbla\EndAccSupp{}
}
\usepackage{accsupp}
\begin{document}
ddd
\end{document}
  • this is exactly what I need, thank you very much! – Ashrak May 16 '16 at 14:06
  • @Steven B. Segletes: Can you please explain your answer a little bit more. I don't understand it. What does the \BeginAccSupp realy does? And why is the accsupp package loaded after and not before? – buhtz Sep 17 '17 at 07:49
  • 2
    @buhtz A PDF file has (potentially) several "layers" of data. The outward is the visual image, which , in and of itself, carries no copy/pastable information. The primary sublayer, if it exists, contains the information about what letters/words occur on the page and in which location. It is this layer that responds to the click and copy command. Theaccsupp package allows one to deliberately place different information on the visual PDF layer from the copy sublayer. In the visual layer, blahbla is the watermark; in the copy layer, nothing {} comprises the watermark. – Steven B. Segletes Sep 17 '17 at 16:42