Skip to main content

Posts

How to Restrict Editing in Word and Allow Specific Editable Ranges in Java

  In contracts, application forms, report templates, and other Word documents, you may need to prevent users from changing certain content while still leaving selected areas editable. For example, a document can be made read-only, restricted to tracked changes or comments, or configured so that only form fields can be filled in. You can also protect most of the document while leaving specific ranges open for editing. These restrictions are different from a document open password. An open password controls whether someone can access the file at all, while editing restrictions control what users can do after the document has been opened. This article shows how to apply editing restrictions to Word documents in Java and how to define editable exceptions inside a protected document. Add the Dependency The examples below use Spire.Doc for Java to work with Word documents. For Maven projects, add its repository and dependency to pom.xml : <repositories> <repository> ...

How to Make PDF Form Fields Read-Only or Flatten Them in Java

  Once a PDF form has been completed, you may want to prevent further edits without losing the form structure, or remove the interactive fields entirely and produce a final version for delivery or archiving. These two requirements are usually handled differently. A read-only field remains part of the PDF form and can still be accessed programmatically, while a flattened field is converted into static page content. This article shows how to make an entire PDF form or an individual field read-only, how to flatten all or selected fields, and when each approach is more appropriate. Add the Dependency The examples below use Spire.PDF for Java to work with PDF forms. For Maven projects, add the following repository and dependency to pom.xml : <repositories> <repository> <id> com.e-iceblue </id> <name> e-iceblue </name> <url> https://repo.e-iceblue.com/nexus/content/groups/public/ </url> </repository...