Welcome Guest Search | Active Topics | Sign In | Register

Prevent text selection Options
Adrien Constant
Posted: Wednesday, April 16, 2014 5:45:01 AM
Rank: Newbie
Groups: Member

Joined: 4/16/2014
Posts: 1
Hello,
I am adding a watermark (draft) on a document, but I want to prevent the text selection of those text blocks (it is weird otherwise).
I didn't find the option to do so, can you help?

i'm basically doing this inside a loop :

Code: C#
//Create a new text layer
                    var textLayer = new PdfTextLayer
                    {
                        Font = new PdfFont("Arial", 12),
                        NonStrokingColor = new PdfColor(0.85f) // light gray
                    };

                    textLayer.GfxMatrix.Rotate(45);

                    //Create the text object
                    var textContent = new PdfTextContent("BROUILLON")
                    {
                        PositionMode = PdfTextPositionMode.Offset,
                        Offset = new PdfPoint(y * 150, x * 75)
                    };

                    //Add the text object into the text layer object
                    textLayer.Contents.Add(textContent);

                    //Add the text layer into the page
                    contents.Add(textLayer);


Thanks.
eo_support
Posted: Wednesday, April 16, 2014 12:20:14 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Hi,

There is no way for you to prevent text selection. The only way you can prevent the text from being selected is to render it as an image instead of as text. This will increase the PDF file size but if your text is not complicated then it shouldn't increase by too much since the images are saved in JPEG format in PDF. Another drawback is the quality of the watermark will suffer when user zooms in or print the document since now it's a bitmap (text are in vector format so they can be zoomed in infinitely without losing quality).

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.