Starting in v2020R2.03+, Qoppa’s PDF API, jPDFProcess, can get and set text color in a PDF document.

This sample shows how to change text content color in a PDF from a given color to a new color.

It gets the TextContent object and group text into spans by text fill color and as lines of text in the page.
It shows how to find text close to a given color and change its color.
It also shows how to search for a string of text within a Span and change the color of a subset of that span.

PDFDocument doc = new PDFDocument("C:/test/TestFile.pdf", null);
for (int i = 0; i < doc.getPageCount(); i++)
{
 PDFPage page = doc.getPage(i);
 TextContent textContent = page.getTextContent();
 
 // Group text into spans by text fill color
 List<FillColorSpan> spans = textContent.getSpans(FillColorSpan.class);
 for (FillColorSpan span : spans)
 {
   // look for spans of text with a fill color close to blue
   if (colorMatch(span.getColor(), 0, 10, 0, 10, 245, 255))
   {
    // change color of entire span
    span.setColor(Color.green);
  }
 }
 
 // Group text into spans that contain a single line of text 
 // (the text may or may not have any attributes in common)
 List<LineSpan> lineSpans = textContent.getSpans(LineSpan.class);
 for (LineSpan span : lineSpans)
 {
   String searchText = "Qoppa";
   // find a string of text within the span
   int startIndex = span.getText().indexOf(searchText);
 
   if (startIndex > -1)
   {
	// change color of a subset of the span (where text was found)
	int endIndex = startIndex + searchText.length();
	span.setColor(Color.red, startIndex, endIndex);
   }
 }
}

Download Full Java Sample to ChangePDFTextColor