How to increase boldness of watermark text using Aspose PDF for Java API

Hi
Am using artifacts to set watermark using below code snippet.

			com.aspose.pdf.Document doc = new com.aspose.pdf.Document(fileDir + File.separator + fname);


			// Create a formatted text
			FormattedText formattedText = new FormattedText(watermarkText, java.awt.Color.RED, FontStyle.Courier, EncodingType.Identity_h, true, 40.0F);

			// Create watermark artifact and set its properties
			//	WatermarkArtifact artifact = new WatermarkArtifact();   
			TextStamp artifact = new TextStamp(formattedText);
			//	artifact.setText(formattedText);        
			//	artifact.setArtifactHorizontalAlignment (HorizontalAlignment.Center);
			//	artifact.setArtifactVerticalAlignment (VerticalAlignment.Center);
			artifact.setHorizontalAlignment(HorizontalAlignment.Center);
			artifact.setVerticalAlignment(VerticalAlignment.Center);
			//	artifact.setRotation (25);
			artifact.setRotateAngle(25);
			artifact.setOpacity (0.5);
			artifact.setBackground (false);

Wanted to increase the boldness of watermark text. Could see setOpacity method is increasing the boldness to an extent if we give a value like 0.9 or 0.7. Is that the correct approach?

What is the maximum value we can given in that case?

Thanks
Sabarish

PR001715sample one.pdf (139.6 KB)

Right now with 0.9 opacity ,I am seeing “Obsolete” watermark text as above.

How to make the obsolete text with the font size mentioned in below image

Obsolete.jpeg (7.4 KB)

Thanks
Sabarish

@sabkan

Have you tried setting font style and other properties like below:

artifact.getTextState().setFont(FontRepository.findFont("Arial"));
artifact.getTextState().setForegroundColor(Color.getBlue());
artifact.getTextState().setFontStyle(FontStyles.Bold | FontStyles.Italic);

Please try setting the appropriate values as per your expectations and let us know if you still are unable to achieve your requirements.

@asad.ali

Thanks for the suggestions.Will check it out.

Sabarish