Indent: not working

Hi,

I am facing problem while applying the indent to the table object.

Attached is the output image for your reference.

Below is the code block,

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.PageSetup.PaperSize = PaperSize.A4;
builder.PageSetup.LeftMargin = 20;
builder.PageSetup.RightMargin = 20;
builder.PageSetup.BottomMargin = 20;
builder.PageSetup.TopMargin = 20;
builder.ParagraphFormat.LeftIndent = 100;
builder.StartTable();
// Table with only one Cell
builder.InsertCell();
builder.CellFormat.LeftPadding = 10;
builder.CellFormat.Width = 200;
builder.InsertHtml("<b>Test Indent</b>");
builder.EndRow();
builder.EndTable();
doc.Save(@"TestIndentOutput.doc", SaveFormat.Doc);
lblMessage.Visible = true;
lblMessage.Text = "Table Created";
builder = null;
doc = null;

Hi
Thanks for your request. You should use RowFormat.LeftIndent in this case. Please see the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.PageSetup.PaperSize = PaperSize.A4;
builder.PageSetup.LeftMargin = 20;
builder.PageSetup.RightMargin = 20;
builder.PageSetup.BottomMargin = 20;
builder.PageSetup.TopMargin = 20;
builder.RowFormat.LeftIndent = 100;
builder.StartTable();
// Table with only one Cell 
builder.InsertCell();
builder.CellFormat.LeftPadding = 10;
builder.CellFormat.Width = 200;
builder.InsertHtml("Test Indent");
builder.EndRow();
builder.EndTable();
doc.Save(@"TestIndentOutput.doc", SaveFormat.Doc);

Best regards.

Thanks for your quick reply.

The solution provided by you worked.

Is there any setting by which I can set right indent too. As we need to implement left and well as right indent for our application on a table object.

Hi
Thanks for your request. Maybe, you should use RightPadding
https://reference.aspose.com/words/net/aspose.words.tables/table/rightpadding/
Best regards.

Hello,

in continuation with my earlier post where i am using InsertHTML method to render HTML tags for the text input.

I am using below statement in which i m setting the FONT color and size of the text, the color gets applied while size is not happening.

builder.InsertHtml("<FONT color=" + "Green" + " size=" +"12"+ ">Test Indent ");

attached is the screen dump for your reference

best regards

Hi
Thanks for your request. I managed to reproduce the problem and created new issue #7459 in our defect database.
This could be fixed on your side by using the following HTML:

builder.InsertHtml("<b>Test Indent</b>");

Best regards.

Hello!
Thank you for your patience. I have some news regarding #7459. This behavior is correct regarding HTML 4.01 specification:
http://www.w3.org/TR/REC-html40/present/graphics.html#edef-FONT
‘size’ attribute value can be an integer with or without a sign. But it cannot have a unit identifier like “pt”, “in”, “px” etc. ‘size’ attribute uses its own measurement unit. If you need to set font size to 12pt then it’s better to specify the following ‘style’ attribute:
Hello!
I’m sorry for my colleague. Adding “pt” to size value in the font element is not valid. In this case attribute parser just ignores the attribute. Since in most cases 12pt is the default size, you can certainly get it accidentially.
Regards,

The issues you have found earlier (filed as 7459) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by alexey.noskov.