Left Indent in Word

Hi,

I’m using ASPOSE.NET to generate word document. The document being generated is a combination of multiple other documents which are all stored in DB as BLOB.

I have a template where a MergeField for LOB is placed between MergeFields[table name ref for DataTable]. When the dataTable assigned to Document builder it Merges all documents [from byte array of Datatable] and generates a final document. I’m using IFieldMergingCallback to capture the and replace the merge field with byte array.

Please see 2 attached doc for your reference. both has 4 paragraphs. Each paragraph are individual document in DB, but merged to create one final docx.

Rightnow, ASPOSE generates document as in CURRENT.docx

Could you please help us how to generate a document as in EXPECTED.docx.

Please note for simplicity, I have given a 4 simple para of data. But in reality, each child document is full-fledged document with tables, formats and few pages of data.

Thank you very much for your help.

Hi Senthil,

Thanks for your inquiry. Your expected document has left indentation for second and forth paragraph. Please use the ParagraphFormat.LeftIndent property to sets the value (in points) that represents the left indent for paragraph as shown in following code snippet.

Document doc = new Document(MyDir + "CURRENT.docx");
Paragraph para = (Paragraph) doc.GetChild(NodeType.Paragraph, 2, true);
para.ParagraphFormat.LeftIndent = 36;
doc.Save(MyDir + "out.docx");

Hope this answers your query. Please let us know if you have any more queries.