![]() ProtectionType ) // 2 - With the correct password: doc. Writeln ( "Text added to a protected document." ) // There are two ways of removing protection from a document. ProtectionType ) DocumentBuilder builder = new DocumentBuilder ( protectedDoc ) builder. ![]() Document protectedDoc = new Document ( ArtifactsDir + "" ) Assert. We have not encrypted the document in any way, and we do not need the password to open and edit it programmatically. Save ( ArtifactsDir + "" ) // Note that the protection only applies to Microsoft Word users opening our document. ![]() ProtectionType ) // If we open this document with Microsoft Word intending to edit it, // we will need to apply the password to get through the protection. Protects the document from changes and optionally sets a protection password.ĭocument doc = new Document () doc. ProtectedForForms = false // In this output document, we will be able to edit the first section freely, // and we will only be able to edit the contents of the form field in the second section. A drop-down menu appears containing several options. AllowOnlyFormFields ) // Turn off write protection for the first section. Go to the File tab, located in the upper-left corner, then select Info from the left menu pane. Regular, "", "Placeholder text", 0 ) // Apply write protection to every section in the document. InsertTextInput ( "TextInput1", TextFormFieldType. Write ( "Please enter text here: " ) builder. ![]() Document doc = new Document () DocumentBuilder builder = new DocumentBuilder ( doc ) builder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |