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: blazor/rich-text-editor/import-export.md
+49-25Lines changed: 49 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -422,21 +422,14 @@ public WordDocument GetDocument(string htmlText)
422
422
423
423
N> [View Sample in GitHub](https://github.com/SyncfusionExamples/blazor-rich-text-editor-export-to-html).
424
424
425
-
## Export Document/PDF with Authentication
425
+
## Secure Exported PDF/Word with Authentication
426
426
427
-
You can add additional data while exporting a document from the Rich Text Editor. When exporting, the OnExport event is triggered, allowing you to:
427
+
You can add additional data while exporting a Word document or PDF from the Rich Text Editor on the client side, which can be received on the server side. By using the `OnExport` event and its `CurrentRequest` and `CustomFormData` properties, you can pass authentication tokens and parameters to the controller action. On the server side, you can fetch the authentication token from the request headers and retrieve the custom form data from the request body, which retrieves the values sent using the POST method.
428
428
429
-
- Add custom headers to the request using the `CurrentRequest` property (for example, passing an authentication token).
430
-
431
-
- Send custom form data to the server using the `CustomFormData` property.
432
-
433
-
On the server side, you can fetch the authentication token from the request headers and retrieve the custom form data.
434
-
435
-
The following example demonstrates how to achieve this:
429
+
The following example demonstrates how to pass authentication tokens and custom data during export:
436
430
437
431
{% tabs %}
438
432
{% highlight razor %}
439
-
440
433
@using Syncfusion.Blazor.RichTextEditor
441
434
<SfRichTextEditor>
442
435
<RichTextEditorEvents OnExport="@Export" />
@@ -455,35 +448,66 @@ The following example demonstrates how to achieve this:
455
448
};
456
449
private void Export(ExportingEventArgs args)
457
450
{
451
+
// Add different authentication tokens based on export type
0 commit comments