- Home
- Forum
- ASP.NET Core - EJ 2
- Restrict editing areas
Restrict editing areas
Hi,
I need to protect certain areas in my document, the restriction feature works very well, but it is done manually.
I need to do this programmatically in the backend of my application and return the sfdt with protected areas, I tried to do it but I wasn't successful
An alternative from the SyncFusion team which is to put the protected areas inside a bookmark and in the document's change event it doesn't allow removing if the mouse cursor is inside a bookmark, this solution works but if I insist by clicking and typing an exception is generated in editor and after that you can edit the content inside the bookmark.
Is there any solution to this issue?
Hi Kurthis, in the documentation it just shows how to protect the entire document, what I need is to specify parts of the document that I want to protect.
Like the image below, but I want to do this programmatically:
Thanks for the response
Suriya, but doing this from the front end would not meet our requirements.
Is there any change to consider this feature in future releases?
This is important for us to be able to do this from the backend.
Thank you for your update.
As mentioned earlier, currently we don’t have a support for restrict/allow editing the particular part of the Word document in DOCIO (back end). We have already logged this as a feature request in our database. We don’t have any immediate plans to implement this feature. We will let you know when this feature is implemented.
The status of the feature can be tracked through below link:
https://www.syncfusion.com/feedback/3173/restrict-editing-for-a-range-or-group-of-elements-in-word-document
For your requirement of editing the particular part of the document, you can use Form Fields in the document which can editable even we set password protection. Please refer the below link to know more about the password protection of form field.
https://help.syncfusion.com/file-formats/docio/working-with-security#protecting-word-document-from-editing
We have attached the simple word document with some form field and also output document which is saved with password protection using DocIO.
https://www.syncfusion.com/downloads/support/forum/168737/ze/Template801368748
Please refer the below code example for the same.
|
WordDocument document = new WordDocument(@"input.docx"); //Sets the protection with password and it allows only to modify the form fields type document.Protect(ProtectionType.AllowOnlyFormFields, "password"); //Saves and closes the Word document instance document.Save("Sample.docx", FormatType.Docx); document.Close(); |
Please let us know if you have any other queries.
- 5 Replies
- 3 Participants
-
TL Tiago Luz
- Sep 9, 2021 04:19 PM UTC
- Oct 6, 2021 12:50 PM UTC