We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ParagraphFormat.FirstLineIndent (hanging indent) sets the Left indent as negative using Java

Hi Team,

First line indent not working when used with hanging indent. I’m using Aspose.Words for Java 13.4.

Correct me if I’m wrong.

setIndent(docBuilder, “first line indent”, 50);
setIndent(docBuilder, “hanging indent”, 100);
docBuilder.write("Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text Dummy text ");

private static void setIndent(DocumentBuilder docBuilder,
String indentType, double indent) {
if (“first line indent”.equals(indentType))
docBuilder.getParagraphFormat().setFirstLineIndent(indent);
else if (“hanging indent”.equals(indentType)) {
double indentNegative = -indent;
docBuilder.getParagraphFormat().setFirstLineIndent(indentNegative);
double leftIndent = 0;
leftIndent = docBuilder.getParagraphFormat().getLeftIndent();
docBuilder.getParagraphFormat().setLeftIndent(leftIndent + indent);
} else if (“left indent”.equals(indentType))
docBuilder.getParagraphFormat().setLeftIndent(indent);
else if (“right indent”.equals(indentType))
docBuilder.getParagraphFormat().setRightIndent(indent);
}

Thanks,
Kumar

Hi Kumar,


Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-8227 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir,


Any plans of fixing this issue anytime sooner?

Thanks,
Kumar

Hi Kumar,


Thanks
for your inquiry. I regret to share with you that the implementation of this issue has been postponed. We will inform you as soon as there are any further developments.

We apologize for your inconvenience.


@kumaraswamy.m

It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-8227) as ‘Not a Bug’.

The hanging indent is set correctly. Please unzip the document and check the indent value. MS Word compensates handing indent with opposite left indent when we do it in MS Word. So the resulting left indent stays 0.