Custom Text or OverlayText for redaction

Hi, I use the PdfViewer control in my WPF project

I would like to set "default" custom text or overlaytext to appear in all redactions added using the tools in the PdfViewer control

I can see from the website guides how to set it if redacting using code, but can't see how I can set text, colour, appearance etc to apply to ALL redacted areas


7 Replies

DR Darren Rose August 21, 2021 03:37 PM UTC

Okay think I have worked part of it out - using below


PDFControl_Redact.RedactionSettings.OverlayText = "UNREGISTERED TRIAL VERSION"
PDFControl_Redact.RedactionSettings.FontSize = 8


But how can I repeat the text ?





DD Divya Dhayalan Syncfusion Team August 23, 2021 05:06 PM UTC

Hi Darren, 
 
We are currently checking on your requirement and we will update further details on 25th August 2021. 
 
Regards, 
Divya 



DG Deepak Gunasekaran Syncfusion Team August 25, 2021 12:15 PM UTC

Hi Darren, 
 
We appreciate your patience. 
 
Regarding the requirement to set default overlay text on all the redacted areas, we have analyzed further and found that it can be achieved when applying the settings after the document is loaded. The DocumentLoaded event notifies you once the document is loaded where you can apply the settings to get it work. We have modified your sample and shared it in the incident ticket (ID: 340273) you have created for this. 
 
Please check and let us know whether it helps you to achieve the requirement. 
 
Regards, 
Deepak G 



DR Darren Rose August 25, 2021 12:24 PM UTC

Hi Deepak


I already have it working to add the text once in each redacted area by adding below to my Form1_Load event


' set redaction overlay text for trial version        
If Licensing.LicenseInfo_LicenseType = Licensing.LicenseTypes.FeatureLimitedTrial Then
            
    WPFUserControl_Redact.PDFControl_Redact.RedactionSettings.OverlayText = "UNREGISTERED TRIAL VERSION"

    WPFUserControl_Redact.PDFControl_Redact.RedactionSettings.FontSize = 8
            
    WPFUserControl_Redact.PDFControl_Redact.RedactionSettings.FontColor = System.Windows.Media.Colors.Red

    WPFUserControl_Redact.PDFControl_Redact.RedactionSettings.UseOverlayText = True
        
End If


BUT I wanted to know how to repeat the text as per question on incident 340273

"But I would like to potentially have the text repeating and from all your examples of doing it in code there is mention of a Repeat or RepeatText parameter e.g.  

and 
Can I set Repeat as default for all redactions like I can set text, font color, font size above? "




DG Deepak Gunasekaran Syncfusion Team August 26, 2021 11:58 AM UTC

Hi Darren, 
 
Sorry for misunderstanding the requirement. We have analyzed further on the Repeat Text in redaction using PDF Viewer, but currently we do not have the support in PDF Viewer UI redaction settings. 
So, we request to use the OverlayText property by sending the repeated text to it as below (for an example). Even if the text is longer, it can be accommodated within the redaction bounds. 
            string repeatedOverlayText = string.Empty; 
            for (int i = 0; i < 10; i++) 
            { 
                for (int j = 0; j < 5; j++) 
                { 
                    repeatedOverlayText += "UNREGISTERED TRIAL VERSION "; 
                } 
                repeatedOverlayText += '\n'; 
            } 
 
Please let us know if you have any concerns. 
 
Regards, 
Deepak G 



DR Darren Rose August 26, 2021 01:31 PM UTC

Okay thanks, I can work with that :)



DD Divya Dhayalan Syncfusion Team August 27, 2021 06:43 AM UTC

Hi Darren, 
 
Most Welcome. Please let us know if you need any further assistance on this. 
 
Regards, 
Divya 


Loader.
Up arrow icon