Based on the code below, I was expecting the word document to have multiple spaces in “Line 1” (I have 5 spaces between “its words”) and also two line breaks between Line 1 and Line 2.
However, all the extra spaces and break lines are being cleaned up.
Can you please let me know what the problem is?
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
string line1 = "Line1 has a lot of text in it. This sentence has two spaces before 'The'. This sentence also has extra spaces within its words.";
string line2 = "Line2";
string line3 = "abcss def";
Thanks for your request. I think in your case you should use instead of white spaces:
“Line1 has a lot of text in it. This sentence has two spaces before ‘The’. This sentence also has extra spaces within its words.”
Or you can try using builder.Writeln method instead of InsertHtml.
Hope this helps.
What about HTML break lines? Having multiple html break lines between Line1 and 2 still does not provide multiple breaks between the two lines. What would I need to do to implement multiple break lines…I’ve tried using InsertBreak(BreakType.LineBreak) and that doesn’t solve the problem either.
Thanks for your inquiry. In this case you can try using Writeln or ParagraphBreak: