How do Text Objects in PDF work?

Viewed 257

I have a PDF document of which I would like to remove watermarks as automatically as possible to get better results from pdftotext.

After uncompressing it with pdftk I see the watermark almost in plain text:

BT
1 0 0 1 277.40012 755.2005 Tm
0.501961 0.501961 0.501961 rg /R1 gs /R2 8 Tf
[()]TJ
0 0 Td
[(Abc)30(defghi K)30(lm)-40(no)]TJ
-5.423981 -9.600038 Td
[()]TJ
0 0 Td
[(Apr 01, 2017 12:34)]TJ
ET

The watermark is

Abcdefghi Klmno
Apr 01, 2017 12:34

After skimming through Document management — Portable document format (especially page 248f), I found the following:

BT: Begin Text
Tm: Text matrix - what is that?
x y Td: Move to the start of the next line with an offset of (x, y)
TJ: Text showing
Tf: Text state
ET: End Text

What I don't understand is all the numbers and why

[(Abc)30(defghi K)30(lm)-40(no)]TJ

Does it increase the space between Abc and defghi K and decrease the space between lm and no (seems so, looking at Figure 46 on page 259)? By what unit?

What does Tf do?

Could somebody please explain that?

2 Answers
Related