Displaying Bold Text in Tagged PDF

Hi Aspose Support,

I was trying to make the heading of a tagged PDF bold, but even though I specify bold I was not getting bold font. Can you check the below code snippet.

HeaderElement heading = taggedContent.createHeaderElement();
heading.setText(“OwnerInfo”);
heading.getStructureTextState().setFont(font);
heading.getStructureTextState().setFontSize((float) 9);
heading.getStructureTextState().setFontStyle(FontStyles.Bold);
heading.getStructureTextState().setMarginInfo(new MarginInfo(30, 0, 0, 3));
heading.getStructureTextState().setForegroundColor(Color.getBlack());
taggedContent.getRootElement().appendChild(heading);

@abrahamaby,

I tried the code in C# and Java, and while the C# version worked and it is the same, the java version failed as you showed.

I will be creating a ticket for the dev team.

@abrahamaby
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-42601

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.