Skip to content

Commit 116c8cd

Browse files
993766: Redaction Annotation in MVC UG Documentation
1 parent 7f9d132 commit 116c8cd

File tree

3 files changed

+51
-48
lines changed

3 files changed

+51
-48
lines changed

Document-Processing-toc.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,16 @@
349349
<li><a href="/document-processing/pdf/pdf-viewer/asp-net-mvc/annotation/annotations-in-mobile-view">Annotations in Mobile view</a></li>
350350
</ul>
351351
</li>
352+
<li>Redaction
353+
<ul>
354+
<li><a href="/document-processing/pdf/pdf-viewer/asp-net-mvc/Redaction/overview">Overview</a></li>
355+
<li><a href="/document-processing/pdf/pdf-viewer/asp-net-mvc/Redaction/ui-interaction">UI Interactions</a></li>
356+
<li><a href="/document-processing/pdf/pdf-viewer/asp-net-mvc/Redaction/programmatic-support">Programmatic Support</a></li>
357+
<li><a href="/document-processing/pdf/pdf-viewer/asp-net-mvc/Redaction/toolbar">Toolbar</a></li>
358+
<li><a href="/document-processing/pdf/pdf-viewer/asp-net-mvc/Redaction/mobile-view">Mobile View</a></li>
359+
<li><a href="/document-processing/pdf/pdf-viewer/asp-net-mvc/Redaction/search-redact">Search Text and Redact</a></li>
360+
</ul>
361+
</li>
352362
<li><a href="/document-processing/pdf/pdf-viewer/asp-net-mvc/interaction-mode">Interaction Mode</a></li>
353363
<li>Form Designer
354364
<ul>

Document-Processing/PDF/PDF-Viewer/asp-net-mvc/Redaction/programmatic-support.md

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ You can add redaction annotations to a PDF document using the `addAnnotation` me
2121
<div style="margin-bottom:8px; display:flex; gap:8px; align-items:center;">
2222
<button id="addRedactAnnot" type="button" onclick="addRedaction()">Add Redaction Annotation</button>
2323
</div>
24-
<ejs-pdfviewer
25-
id="pdfViewer"
26-
style="height:640px; display:block"
27-
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib"
28-
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf">
29-
</ejs-pdfviewer>
24+
@Html.EJS().PdfViewer("pdfViewer")
25+
.ResourceUrl("https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib")
26+
.DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf")
27+
.Height("640px")
28+
.Render()
3029
</div>
3130
<script type="text/javascript">
3231
window.onload = function () {
@@ -69,12 +68,11 @@ Redaction annotations can be removed using the `deleteAnnotationById` event or b
6968
<div style="margin-bottom:8px;">
7069
<button type="button" onclick="deleteAnnotationById()">Delete Annotation By Id</button>
7170
</div>
72-
<ejs-pdfviewer
73-
id="pdfViewer"
74-
style="height:640px; display:block"
75-
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib"
76-
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf">
77-
</ejs-pdfviewer>
71+
@Html.EJS().PdfViewer("pdfViewer")
72+
.ResourceUrl("https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib")
73+
.DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf")
74+
.Height("640px")
75+
.Render()
7876
</div>
7977
<script type="text/javascript">
8078
window.onload = function () {
@@ -111,12 +109,11 @@ You can update properties of an existing redaction annotation using the `editAnn
111109
<div style="margin-bottom:8px; display:flex; gap:8px;">
112110
<button id="editRedactAnnotation" type="button" onclick="editRedactAnnotation()">Edit Redact Annotation</button>
113111
</div>
114-
<ejs-pdfviewer
115-
id="pdfViewer"
116-
style="height:640px; display:block"
117-
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib"
118-
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf">
119-
</ejs-pdfviewer>
112+
@Html.EJS().PdfViewer("pdfViewer")
113+
.ResourceUrl("https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib")
114+
.DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf")
115+
.Height("640px")
116+
.Render()
120117
</div>
121118
<script type="text/javascript">
122119
window.onload = function () {
@@ -162,12 +159,11 @@ Entire pages can be marked for redaction using the `addPageRedactions` method:
162159
<div style="margin-bottom:8px; display:flex; gap:8px; align-items:center;">
163160
<button id="addPageRedactions" type="button" onclick="addPageRedactions()">Add Page Redaction</button>
164161
</div>
165-
<ejs-pdfviewer
166-
id="pdfViewer"
167-
style="height:640px; display:block"
168-
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib"
169-
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf">
170-
</ejs-pdfviewer>
162+
@Html.EJS().PdfViewer("pdfViewer")
163+
.ResourceUrl("https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib")
164+
.DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf")
165+
.Height("640px")
166+
.Render()
171167
</div>
172168
<script type="text/javascript">
173169
window.onload = function () {
@@ -199,12 +195,11 @@ Once annotations are added, you can permanently apply them to the document using
199195
<div style="margin-bottom:8px; display:flex; gap:8px; align-items:center;">
200196
<button id="redact" type="button" onclick="applyRedaction()">Apply Redaction</button>
201197
</div>
202-
<ejs-pdfviewer
203-
id="pdfViewer"
204-
style="height:640px; display:block"
205-
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib"
206-
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf">
207-
</ejs-pdfviewer>
198+
@Html.EJS().PdfViewer("pdfViewer")
199+
.ResourceUrl("https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib")
200+
.DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf")
201+
.Height("640px")
202+
.Render()
208203
</div>
209204
<script type="text/javascript">
210205
window.onload = function () {
@@ -234,12 +229,11 @@ You can configure default properties for redaction annotations (such as fill col
234229
{% tabs %}
235230
{% highlight cshtml tabtitle="Standalone" %}
236231
<div class="text-center">
237-
<ejs-pdfviewer
238-
id="pdfViewer"
239-
style="height:640px; display:block"
240-
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib"
241-
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf">
242-
</ejs-pdfviewer>
232+
@Html.EJS().PdfViewer("pdfViewer")
233+
.ResourceUrl("https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib")
234+
.DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf")
235+
.Height("640px")
236+
.Render()
243237
</div>
244238
<script type="text/javascript">
245239
window.onload = function () {

Document-Processing/PDF/PDF-Viewer/asp-net-mvc/Redaction/search-redact.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,26 @@ N> Prerequisites: Add the PdfViewer control to your ASP.NET MVC application and
2323

2424
{% tabs %}
2525
{% highlight cshtml tabtitle="Standalone" %}
26-
@page
27-
@model IndexModel
2826
@{
29-
ViewData["Title"] = "Search text and redact";
27+
ViewBag.Title = "Search text and redact";
3028
}
29+
3130
<div class="content-wrapper">
3231
<div style="margin-bottom:8px; display:flex; gap:8px; align-items:center;">
3332
<button id="searchTextRedact" type="button" onclick="searchTextAndRedact()">Search "syncfusion" & Mark for Redaction</button>
3433
<button id="applyRedaction" type="button" onclick="applyRedaction()">Apply Redaction</button>
3534
</div>
3635

37-
<ejs-pdfviewer
38-
id="pdfViewer"
39-
style="height:640px; display:block"
40-
resourceUrl="https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib"
41-
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
42-
isExtractText="true">
43-
</ejs-pdfviewer>
36+
@Html.EJS().PdfViewer("pdfViewer")
37+
.Height("640px")
38+
.ResourceUrl("https://cdn.syncfusion.com/ej2/31.2.12/dist/ej2-pdfviewer-lib")
39+
.DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf")
40+
.IsExtractText(true)
41+
.Render()
4442
</div>
43+
4544
<script type="text/javascript">
46-
window.onload = function () {
45+
document.addEventListener('DOMContentLoaded', function () {
4746
window.viewer = document.getElementById('pdfViewer').ej2_instances[0];
4847
// Primary toolbar including Redaction
4948
viewer.toolbarSettings = {
@@ -53,7 +52,7 @@ N> Prerequisites: Add the PdfViewer control to your ASP.NET MVC application and
5352
'FormDesignerEditTool', 'SearchOption', 'PrintOption', 'DownloadOption'
5453
]
5554
};
56-
};
55+
});
5756

5857
// Finds "syncfusion" and adds redaction annotations for each match
5958
async function searchTextAndRedact() {

0 commit comments

Comments
 (0)