TextStamp color removed when includes special characters

Hello,
I am using Aspose.words to generate pdf.
I have the following method that adds a header stamp to my documents when we download them:

private TextStamp createHeaderStamp(String headerStamp) {

	TextStamp textStamp = new TextStamp(String.format("%s", headerStamp));
	textStamp.getTextState().setFontSize(8);
	textStamp.getTextState().setFontStyle(FontStyles.Regular);
	textStamp.getTextState().setForegroundColor(Color.getGray());
	textStamp.setOpacity(0.5);
	textStamp.setVerticalAlignment(VerticalAlignment.Top);
	textStamp.setHorizontalAlignment(HorizontalAlignment.Left);
	textStamp.setLeftMargin(5);
	textStamp.setTopMargin(5);
	LOGGER.info("Header text stamp {}", textStamp.getValue());
	return textStamp;
}

As you can see, we set the color of the text to grey.

I am now facing a strange bug:
When the text contains contains special characters (for example važeća in Croatian), the textStamp is added in color white and seams invisible.

I’ll truly appreciate your review.
Thank you.

@LeahGreen The code you have provided is not related to Aspose.Words. It looks like you are using Aspose.PDF to ass text stamps to your PDF documents. I will move your topic to the appropriate forum. My colleagues will help you shortly.
For now, please attach your problematic input and output documents here for our reference.

Ok. Thanks.
I currently can’t share the output file, because it contains some other data that shouldn’t be visible to public.
If there is a way to share it privately I’ll appreciate it.

@LeahGreen

We testing using 24.12 version of the API and could not replicate the issue in our environment. Please check attached output PDF document.
sample_output.pdf (76.3 KB)

We need sample source PDF to replicate the issue in our environment. Hence, sending you a private message where you can share your file.

@asad.ali
Thank you!