Hi,
we are using aspose-word licensed version 14.12.0.0 and aspose-pdf version 8.2.0. I would like to
generate the document with content controls and document generated successfully. But we are facing some alignment issue. Please see the we attached the sample project and screenshot for your review and give me the solution based on our sample project.
Is there any way to avoid this alignment issue. How can i achieve this?.
Note: Please include the dll aspose-word version 14.12.0.0 and aspose-pdf version 8.2.0.
We are using following code for table/paragraph issue.
string File = “D:\Table Issue.Docx”;
Aspose.Words.Document doc = new Aspose.Words.Document(File);
List<string> Tags = new List<string>();
List<string> Row1 = new List<string>();
Row1.Add("Test1");
Row1.Add("Test2");
string value1 = string.Join(Aspose.Words.ControlChar.LineBreak, Row1);
List<string> Row2 = new List<string>();
Row2.Add("These messages also appear in green text bubbles and go through your carrier. Group SMS messages don’t support multimedia attachments, like photos or videos. All responses in a Group SMS are sent as individual text messages and the recipients can’t see the other responses from the group.");
Row2.Add("These messages appear in green text bubbles and go through your carrier instead of Apple. In a group MMS, everyone can:Send and receive photos and videos See all responses from the group Mute notifications.");
string value2 = string.Join(Aspose.Words.ControlChar.LineBreak, Row2);
List<string> Row3 = new List<string>();
Row3.Add("Test Row1");
Row3.Add("Test Row2");
string value3 = string.Join(Aspose.Words.ControlChar.Lf, Row3);
Dictionary <string, string> aProductCost = new Dictionary<string, string>();
aProductCost.Add("PL_Test_Network1", value1);
aProductCost.Add("PL_Test_Network2", value2);
aProductCost.Add("PL_Test_Network3", value3);
List<Aspose.Words.Markup.StructuredDocumentTag> sdtNodes = doc.GetChildNodes(NodeType.StructuredDocumentTag, true).Cast<Aspose.Words.Markup.StructuredDocumentTag>().ToList<Aspose.Words.Markup.StructuredDocumentTag>();
string Value = string.Empty;
foreach (Aspose.Words.Markup.StructuredDocumentTag cc in sdtNodes)
{
Value = aProductCost[cc.Title];
if (Value != null) //when found, apply the value.
{
mergeDataToContentControl(cc, Value);
}
}
System.IO.MemoryStream outStream = new System.IO.MemoryStream();
doc.Save(outStream, Aspose.Words.SaveFormat.Docx);
byte[] docBytes = null;
docBytes = outStream.ToArray();
FileStream output = new FileStream("D:\\Table Issue1.Docx", FileMode.Create,
FileAccess.Write);
// Write byte array contents in the output file stream**
output.Write(docBytes, 0, docBytes.Length);
// Close output file
output.Close();
Table Issue.zip (1.3 MB)
Excepted Output.jpg (58.0 KB)
CurrentOutput.jpg (67.0 KB)