Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In Is it possible to produce a PDF with un-copyable text?, it was suggested the following code to disable the coyable text from a pdf viewer.

% pdflatex is required
\documentclass{article}
\usepackage[resetfonts]{cmap}
\usepackage{fancyvrb}
\begin{VerbatimOut}{OT1.cmap}
%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1-0)
%%Title: (TeX-OT1-0 TeX OT1 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (OT1)
/Supplement 0
>> def
/CMapName /TeX-OT1-0 def
/CMapType 2 def
1 begincodespacerange
<00> <7F>
endcodespacerange
8 beginbfrange
<00> <01> <0000>
<09> <0A> <0000>
<23> <26> <0000>
<28> <3B> <0000>
<3F> <5B> <0000>
<5D> <5E> <0000>
<61> <7A> <0000>
<7B> <7C> <0000>
endbfrange
40 beginbfchar
<02> <0000>
<03> <0000>
<04> <0000>
<05> <0000>
<06> <0000>
<07> <0000>
<08> <0000>
<0B> <0000>
<0C> <0000>
<0D> <0000>
<0E> <0000>
<0F> <0000>
<10> <0000>
<11> <0000>
<12> <0000>
<13> <0000>
<14> <0000>
<15> <0000>
<16> <0000>
<17> <0000>
<18> <0000>
<19> <0000>
<1A> <0000>
<1B> <0000>
<1C> <0000>
<1D> <0000>
<1E> <0000>
<1F> <0000>
<21> <0000>
<22> <0000>
<27> <0000>
<3C> <0000>
<3D> <0000>
<3E> <0000>
<5C> <0000>
<5F> <0000>
<60> <0000>
<7D> <0000>
<7E> <0000>
<7F> <0000>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF
\end{VerbatimOut}

\usepackage{lipsum}

\begin{document}

\lipsum

\end{document}

This procedure works with pdfLaTeX and LuaTeX.

In the second case(compile with LuaTeX), when I use some fonts I have installed on my OS, does't work. Is it because I have to write another cmap file? If yes, how can I write it? If there is no LuaLaTeX solution, can somebody tell me if there is an external free software capable of removing copyable text from a pdf?

share|improve this question
8  
I am sure it can be done, but unless you are willing to pay me, i am not going to spend any of my time thinking about adding DRM measures to luatex output. –  Taco Hoekwater Jun 3 '11 at 17:28
    
@ Taco Hoekwater: I'm ignorant about drm and i didn't ask you to spend time over a my problem. Can you or other give me some references to solve my problem? –  Azoun Jun 3 '11 at 18:20
4  
You don't need references. If you have available a thing called "a typist", no possible drm on earth can resist you. –  Brent.Longborough Jun 3 '11 at 21:25
1  
There are different ways to make it hard to copy text from a pdf file. None of them really works reliably and in all the available pdf viewers. If the characters are shown on the screen almost every OCR software can create a text file from an image within seconds. So why create possible problems with a non-standard pdf file when it not even provides not even a small barrier against copying? –  Alexander Nov 12 '11 at 18:04

1 Answer 1

When using LuaTeX and system OpenType fonts, the CMAP resource is inside the fonts; so unless one is able to find a way to override the resource written in the PDF file when the font is (partially) embedded, I think there's no way to achieve your plan.

Actually, if I compile your example, open the PDF with Skim (on Mac OS X), select the word "sollicitudin", do "Copy" from the menu and do "Paste" into a Emacs window, I get

^R^N^K^K^H^B^H^S^T^C^H

so the letters "s o l i c t u d" are recognizable (and are rendered the same throughout the document). Other letters result in different control characters and when one has available half the alphabet, the rest is quite easily decoded.

Thus your method doesn't really work against copying the text. Moreover an OCR device will retrieve the text almost instantly and correctly, as the definition of the characters is high. One can defeat DRM on music by playing and recording it; the quality lowers, of course. Text can be retyped quickly without loss of quality, with good proofreading.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.