We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

DocumentBuilder.insertHtml() in mailmerge process corrupts the next head line format

Dear aspose team,

with Aspose 13.10 (and 13.7 and 13.0) the call of DocumentBuilder.insertHtml() corrupts the format of the next head line in the document.

I could reproduce the behaviour with following simple junit-test:

@Test
public void testInsertHTML() throws Exception{
Document document = new Document(TestAsposeDocument.class.getResourceAsStream(“htmlinput.docx”));
document.getMailMerge().setFieldMergingCallback(new IFieldMergingCallback() {
@Override
public void fieldMerging(FieldMergingArgs fieldMergingArgs) throws Exception {
if(fieldMergingArgs.getFieldName().equals(“FIELD”)) {
DocumentBuilder builder = new DocumentBuilder(fieldMergingArgs.getDocument());
builder.moveToMergeField(fieldMergingArgs.getFieldName());
builder.insertHtml("

<p style=“margin:0pt”><span style=“font-family:Arial; font-size:10pt”>fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
");
fieldMergingArgs.setText("");
}
}

@Override
public void imageFieldMerging(ImageFieldMergingArgs imageFieldMergingArgs) throws Exception {

}
});
document.getMailMerge().execute(new String[]{“FIELD”}, new Object[]{“TESTVALUE”});

document.save(“D:\testHtmlOut.docx”, SaveFormat.DOCX);
}



The input document is “htmlinput.docx”, the output document is “testHtmlOut.docx”. You can see that the head line in testHtmlOut.docx is significant larger than in the original document.


Cheers

Hi Jens,

Thanks for your inquiry. I tested the scenario with Aspose.Words 13.11.0 and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-9448. We will further look into the details of this problem and keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Hi Awais,

how is the progress on this issue?

Thanks & Cheers

Hi Jens,


Thanks for your inquiry. Unfortunately, your issue is not resolved yet. Our development team has completed the analysis of this issue and the root cause has been identified. However, the implementation of the fix of this issue has been postponed till a later date. We will inform you via this thread as soon as this is resolved. We apologize for your inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-9448) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.