Coloring text programmatically comes up more than you'd expect once you're generating or post-processing Word files from Java — flagging changed clauses in a contract, marking up review comments, or just making a generated report easier to skim. There's more than one way to do it, and which one you reach for depends on whether you're coloring a whole paragraph, a specific run of text, or every occurrence of a keyword across the document. Here's how each one works, and a couple of things that aren't obvious until you hit them. Setup The examples below use Spire.Doc for Java. With Maven, add the 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> </repositories> <dependencies> <dependency> <groupId> e-...
File APIs for Word/Excel/PowerPoint/PDF
A blog about Microsoft Office and PDF document development using .NET and Java.