C#-Aspose.Words-去掉单元格默认首行缩进2个字符的问题
Document doc = new Document(tmppath); //载入模板
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("PO_regTable0");// 定位到书签去
string ctitle = "抽查内容_79,序号_59,存在问题_110,依据_100,类别_59,备注_89";
string ftitle = "NormMainName,NOs,NewContent,Deregulation,cType,Remark";
string[] strTitleName = ctitle.Split(',');
int dataRowCount = dt1.Rows.Count;
for (int j = 0; j < strTitleName.Length; j++)
{
string filedName = strTitleName[j].Split('_')[0].ToString();
builder.InsertCell();// 添加一个单元格
builder.CellFormat.Width = Convert.ToInt32(strTitleName[j].Split('_')[1].ToString());
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;//垂直居中对齐
/**
* 去掉默认首行缩进2个字符的问题
*/
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中
builder.ParagraphFormat.FirstLineIndent = 0;//去掉首行缩进的问题
//builder.ParagraphFormat.LeftIndent = -1 * 14;//-1 * 28.35;非首行缩进的问题 不行
builder.Write(filedName);
}
builder.EndRow();