How to Make Text Font Bold Using Aspose.Slides for Node.js?

Hi support,
How to make text formate Bold.
I’ve tried this
image.png (10.5 KB)

but getting the below error
image.png (23.6 KB)

@karanmarsh,
Thank you for contacting support.

I am working on the question and will get back to you as soon as possible.

@karanmarsh,
We have opened the following new ticket(s) in our internal issue tracking system and will consider the question according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNODEJS-43

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.

@karanmarsh,
Because JavaScript does not have the concept of a byte, you should use the following code:

portion1.getPortionFormat().setFontBold(java.newByte(aspose.slides.NullableBool.True));

Full code snippet:

// Instantiate the presentation.
var pres = new aspose.slides.Presentation();

// Get the first slide.
var sld = pres.getSlides().get_Item(0);

// Add a Rectangle shape.
var rect = sld.getShapes().addAutoShape(aspose.slides.ShapeType.Rectangle, 100, 100, 500, 150);

// Add a TextFrame to the Rectangle.
var tf = rect.addTextFrame("This is the text");

// Get the first Portion of the first Paragraph in the TextFrame. 
var portion1 = tf.getParagraphs().get_Item(0).getPortions().get_Item(0);

 // Setting the font style.
portion1.getPortionFormat().setFontBold(java.newByte(aspose.slides.NullableBool.True));

// Save the presentation.
pres.save(dataDir + "FontBold.pptx", aspose.slides.SaveFormat.Pptx);
1 Like

Resolved. Thanks

@karanmarsh,
Thank you for using Aspose.Slides.