0

I created accessible pdf using itext 7 and added watermark text to the pdf as below.

//create canvas    
canvas.ShowTextAligned(new Paragraph(watermarkText),x,y,textalign);

Watermark text gets applied to the pdf but it can be selected.

How can I disable the watermark text selection?

  • 1
    There is probably an answer to your question, but before I can answer, please clarify: you say that you are using iText 7, but when I look at your code, I see that you use the `ColumnText` class. The `ColumnText` class doesn't exist in iText 7; it only exists in iText 5. If I would search for the iText 7 answer, it wouldn't be helpful for you if you are, in fact, using iText 5. – Bruno Lowagie Sep 20 '18 at 06:33
  • Sorry I changed the code. I'm using iText 7 – Anuk Samarasinghe Sep 20 '18 at 07:26
  • PDF viewers often do not allow selection of text drawn in a pattern. In this context [this answer](https://stackoverflow.com/a/20361261/1729265) is related to the topic at hand, it discusses watermark text in patterns with iText 5 – mkl Sep 20 '18 at 13:23
  • Does this answer your question? [can we add multiline textual watermark in a document using latest iText jar?](https://stackoverflow.com/questions/60000879/can-we-add-multiline-textual-watermark-in-a-document-using-latest-itext-jar) The mechanism used there, watermark text in pattern, usually results in non-selectable text. – mkl Aug 02 '21 at 06:43

0 Answers0