You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: File-Formats/PDF/Working-with-Redaction.md
+150-1Lines changed: 150 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -812,4 +812,153 @@ loadedDocument.Close(True)
812
812
813
813
{% endtabs %}
814
814
815
-
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Redaction/Redaction/Redact-text-content-alone-on-the-redated-area/).
815
+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Redaction/Redaction/Redact-text-content-alone-on-the-redated-area/).
816
+
817
+
818
+
## Find text by regular expression pattern and redact it from PDF document.
819
+
820
+
You can find text by regular expression pattern and redact it from PDF document using the [PdfRedaction](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.Redaction.PdfRedaction.html#Syncfusion_Pdf_Redaction_PdfRedaction__ctor_System_Drawing_RectangleF_) class.
821
+
822
+
The following code snippet explains how to find text by regular expression pattern and redact it from PDF document.
823
+
824
+
{% tabs %}
825
+
826
+
{% highlight c# tabtitle="C# [Cross-platform]" %}
827
+
828
+
//Create stream from an existing PDF document.
829
+
FileStream docStream = new FileStream(Path.GetFullPath("Input.pdf"), FileMode.Open, FileAccess.Read);
830
+
831
+
//Load the existing PDF document.
832
+
PdfLoadedDocument document = new PdfLoadedDocument(docStream);
833
+
834
+
//Get the first page from the document.
835
+
PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
836
+
837
+
TextLineCollection collection = new TextLineCollection();
0 commit comments