title: how to make my watermark text in any pdf file as non-selectable?
body: <p>I have done watermark text in pdf file using itextpdf, but when I copy the actual text of the pdf file it allows us to copy the watermark text too. Is there anyway that we can restrict our watermark text as Non-selectable?</p>
  
  <pre><code>Image watermark_image = Image.getInstance(imageFile.getAbsolutePath());
  
  while (i &lt; num_of_pages) {
      i++;
      //To pass our watermark over text
      add_waterMark = pdfStamper.getOverContent(i);
  
      //To pass our watermark under text
      //add_waterMark = pdfStamper.getUnderContent(i);
  
      // watermark_image.
      watermark_image.setAbsolutePosition(0, 0);
  
      add_waterMark.beginText();
      //add_waterMark.setTextRenderingMode(number_of_pages);
  
      //watermark_image is png file
      add_waterMark.addImage(watermark_image);
  
      add_waterMark.endText();
  }
  </code></pre>
  
  <p>i have written code using PdfContentByte, it is hollow and horizontal, but i am able to copy the watermark text here :(
  i want to replace my code using PdfPatternPainter, if may be possible because PdfPatternPainter inherits all the Fields of PdfContentByte.</p>
  
  <p>here is code using PdfContentByte :</p>
  
  <pre><code>int n = reader.getNumberOfPages();
  
          PdfContentByte under;
          PdfGState gstate = new PdfGState();
          gstate.setFillOpacity(0.35f);
          gstate.setStrokeOpacity(0.35f);
          BaseFont font = BaseFont.createFont(BaseFont.HELVETICA_BOLD,
                  BaseFont.WINANSI, BaseFont.EMBEDDED);
  
          Rectangle size = reader.getPageSizeWithRotation(1);
  //          float angle = (float) ((180 * (Math.asin(size.getHeight()
  //                  / Math.sqrt(size.getWidth() * size.getWidth()
  //                          + size.getHeight() *       size.getHeight())))) / Math.PI);
          int i = 1;
  
          while (i &lt; n + 1) {
  
              under = stamper.getOverContent(i);
              under.setColorStroke(new BaseColor(192, 192, 192));
              i++;
              under.beginText();
                  under.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_STROKE);
              under.setLineWidth(0.85f);
              under.setLineDash(0.4f, 0.4f, 0.2f);
  
              under.showTextAlignedKerned(Element.ALIGN_MIDDLE,
                      "user name must required", 250, 780,
                      MYConstants.WATERMARK_PAGE_ANGLE);
              under.setFontAndSize(font, 42);
              under.showTextAlignedKerned(Element.ALIGN_MIDDLE,
                      "user Company name required", 200, 730,
                      MyConstants.WATERMARK_PAGE_ANGLE);
              under.setFontAndSize(font, 42);
              under.showTextAlignedKerned(Element.ALIGN_MIDDLE,
                      "Plesae enter your email id", 150, 680,
                      MyConstants.WATERMARK_PAGE_ANGLE);
  
  
              under.endText();
          }
  
       stamper.close();
  } 
  </code></pre>