Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Sep 28, 2017 6:04 am

Hello Support team,

Please see the document attached. We have two problems generating a document like that and I want to ask how to achieve that with Spire.Doc
1. Protection Level:
The closest I can get to the behavior getting by Word is using AllowOnlyFormFields
Then I can Edit the Content of the RichtText Field but can#t use any formatting functions and format templates from the ribbon. This works using the attached (Word generated) file

Even if I take this (attached) document, Load and Save it the Protection Level seems to change as I lose the editing and formatting ability completely
Code: Select all
Document document = new Document();
document.LoadFromFile(sourceFile);

document.SaveToFile(filename, FileFormat.Docx);


2. How can I a new added StructureDocumentTag get to the editable (not locked) mode like the one in the sample. If I do something like
Code: Select all
var newsdt = new Spire.Doc.Documents.StructureDocumentTag(document);

            newsdt.SDTProperties.Alias = "Test2";
            newsdt.SDTProperties.Tag = "Test2_Tag";
            //newsdt.SDTProperties.IsShowingPlaceHolder = true;
            newsdt.SDTProperties.SDTType = SdtType.RichText;
           

            var sdtpa = newsdt.SDTContent.AddParagraph();

            sdtpa.Text = "Das ist der Inhalt des neuen Paragraphs";
           
            document.Sections[0].Paragraphs.Add(sdtpa);


I can’t find a Property where to set the protection of the Richtext field

Best regards

arne.weber@webtelligence.net
 
Posts: 19
Joined: Mon Sep 19, 2016 6:52 am

Thu Sep 28, 2017 9:14 am

Hello,

Thanks for your inquiry.
After an investigation, we found that the partial editing restriction was not supported by Spire.Doc at present. This is the cause of your two issues. Anyway, I have added this new feature into our schedule and once there's any update, I will let you know.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Oct 04, 2017 10:30 am

Hi Jane,

can you give us rought information about if and when the feature will be implemented.

Best regards,
Arne

arne.weber@webtelligence.net
 
Posts: 19
Joined: Mon Sep 19, 2016 6:52 am

Thu Oct 05, 2017 2:56 am

Hello Arne,

Thanks for your post.
Sorry there’s no any information about the ETA at present and we are having our Chinese National holiday from Oct.1 to Oct.8 (GTM+8). Once I got any update later, I will inform you.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Nov 06, 2017 7:19 am

Hello Jane,

is there any news on this issue?

Best regards,
Arne

arne.weber@webtelligence.net
 
Posts: 19
Joined: Mon Sep 19, 2016 6:52 am

Mon Nov 06, 2017 8:06 am

Hi Arne,

Thanks for contacting us.
Sorry there's no significant progress so far, and our dev team is still looking for the solution. Considering the situation, I will give a higher priority to your case. Once there's any update, I will let you know.
We apologize for the inconvenience caused.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Dec 22, 2017 7:09 am

Hello,

Glad to inform that the issue has been resolved and the hotfix(Spire.Doc Pack(hot fix) Version:6.0.87) is available now.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Tue Feb 19, 2019 9:02 am

Dear Arne,

How are you?
Glad to inform that the partial protection feature is available now. Please download the hotfix Spire.Doc Pack(hot fix) Version:7.1.19 and refer to the code below to add an editable rich text control in a read only document.
Code: Select all
//create a  Document
Document document = new Document();
Section section = document.AddSection();
section.AddParagraph().AppendText("This text is readonly. ");
section.AddParagraph();
Paragraph paragraph = section.AddParagraph();

//add partial permission start
paragraph.ChildObjects.Insert(0, new PermissionStart(document, "myPermission"));

//add the editable content
StructureDocumentTagInline newsdt = new StructureDocumentTagInline(document);
paragraph.ChildObjects.Add(newsdt);

newsdt.SDTProperties.Tag = "Test2_Tag";
newsdt.SDTProperties.Alias = "Test2";
newsdt.SDTProperties.SDTType = SdtType.RichText;
TextRange rt = new TextRange(document);
rt.Text = "Das ist der Inhalt des neuen Paragraphs.";
newsdt.SDTContent.ChildObjects.Add(rt);

//permission end
paragraph.ChildObjects.Add(new PermissionEnd(document, "myPermission"));

//set document other parts to be readonly
document.Protect(ProtectionType.AllowOnlyReading, "e-iceblue");

document.SaveToFile("PartialProtect.docx");


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.Doc

cron