Extra spaces appearing

Hi

We've noticed that some of our generated files have extra spaces appearing in the document.

If you use the attached document with the following code you can see that an extra space appears before the "End-of-course Assessment".


string licenseFile = "Aspose.Custom.lic";

if (System.IO.File.Exists(licenseFile))

{

Aspose.Word.License license = new Aspose.Word.License();

license.SetLicense(licenseFile);

}

// Open the template

template_doc = new Document("cq_pdf_template.doc");

builder = new DocumentBuilder(template_doc);

builder.MoveToMergeField("merge_computer_required");

builder.Write("Computer optional");

builder.Write("\n");

builder.MoveToMergeField("merge_residential_school");

builder.Write("No residential school");

builder.Write("\n");

builder.MoveToMergeField("merge_exams");

builder.Write("End-of-course assessment");

builder.Write("\n");

template_doc.MailMerge.DeleteFields();

template_doc.Save("test.doc");





Is there anything that can be done to fix this?

Thanks
--
Stuart Crouch

Please ignore this thread. I’ve found the problem and it was in the template.