How to set and reset the Hanging indentation and left indent and how to find the para with bulletin

Hi Team,

I have two queries.

  1. How to set and reset hanging indent property through Aspose word Dot net.
  2. What Property identify a para with bulletin.

Attached the necessary screenshots and a sample template.
image.png (274.1 KB)

Sample Document: SampleDoc.docx (13.2 KB)

Thanks,
Karthikeyan

@Karthik_Test_account

  1. You can use ParagraphFormat.FirstLineIndent property to specify hanging indentation. Use positive values to set the first-line indent, and negative values to set the hanging indent.

  2. You can use Paragraph.IsListItem to check whether paragraph is a list item.

@alexey.noskov - I have a concern I am trying to apply two property for a para

  1. Set Left Indent and
  2. Set FirstLineIndent

But only one property is getting assigned to the para like the first property is alone getting assigned. Can you please confirm If I need to do anything different here?

@Karthik_Test_account FirstLineIndent and LeftIndent of paragraph are different options. Please see the following screenshot:

You can see these options in paragraph properties:

@alexey.noskov - If that’s the case how do I achieve this output with Aspose word. That is having both left indent and Hanging property.

Word Configuration:
image.png (15.5 KB)

Output:
image.png (6.1 KB)

Regards,
Karthikeyan

@Karthik_Test_account You should use code like the following:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Set hanging identation.
builder.ParagraphFormat.FirstLineIndent = -ConvertUtil.MillimeterToPoint(6.3);
// Specisfy left indent
builder.ParagraphFormat.LeftIndent = ConvertUtil.MillimeterToPoint(6.3) - builder.ParagraphFormat.FirstLineIndent;

builder.Write("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu arcu semper, faucibus ante blandit, consequat tellus. In ac ultricies dolor. Ut est lacus, aliquet nec feugiat vel, commodo non eros. Cras sed euismod risus. Quisque diam leo, sodales elementum augue a, fringilla imperdiet justo. Etiam justo erat, laoreet quis egestas aliquam, mattis feugiat neque. Vestibulum nec suscipit sem, id elementum ex. Suspendisse leo metus, molestie nec ante non, pulvinar sollicitudin lacus. Nam consequat dignissim cursus. Integer tellus nunc, pharetra sed metus ac, blandit feugiat turpis. Fusce maximus tortor id urna tincidunt feugiat.");

doc.Save(@"C:\Temp\out.docx");