Hello Charan,
Thanks for your inquiry.
It is infeasible to make a certain "page" read only, because our Spire.DOC is based on MS Word, the Word document is a flow document and does not contain any information about its layout into pages. But, our Spire.DOC supports making the specified content read only while creating document. Please refer to the following sample code to achieve it, if there is any question, just feel free to write back.
- Code: Select all
Document doc = new Document();
Section section = doc.AddSection();
Paragraph para1 = section.AddParagraph();
//add permission start
para1.ChildObjects.Insert(0, new PermissionStart(doc, "myPermission"));
para1.AppendText("this is para1.");
//add permission end
para1.ChildObjects.Add(new PermissionEnd(doc, "myPermission"));
//set document other parts to be readonly
doc.Protect(ProtectionType.AllowOnlyReading, "123");
Paragraph para2 = section.AddParagraph();
para2.AppendText("this is para2.");
Paragraph para3 = section.AddParagraph();
para3.AppendText("this is para3.");
doc.SaveToFile("result.docx");
Sincerely,
Lisa
E-iceblue support team