I’m currently in the progress of migrating our process of generating Word Documents over to Aspose. My question is how i can generate a LineBreak using String format properties. For example I would expect a \n to create a new line in Word. But when I insert a string containing \n there’s more than one new line inserted (see attatched picture which shows my problem in the table at third row, first column)
another thing. when you look into the first row second columen. there’s a paragraph break behind the text. the text is inserted using “DocumentBuilder.insertHtml()” how can i prevent the paragraph break behind inserted html?
Thanks for your inquiry. I suppose your HTML contains
tags, during html import these tags are converted to paragraphs.
Please try using the following code:
Document doc = new Document("C:\\Temp\\in.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.moveToCell(0, 0, 0, 0);
builder.insertHtml("Test");
doc.save("C:\\Temp\\out.doc");