we used 20.6 version of aspose. after upgrade to 20.12 we see another html.
For example
source html: <p style="margin-top:0pt; margin-bottom:0pt; font-size:12pt"> <span style="font-family:'Times New Roman'">Simple document with one paragraph and no additional formatting.</span> </p>
change html:
<p style="font-size:12pt; margin-bottom:0pt; margin-top:0pt"><span style="font-family:'Times New Roman'">Simple document with one paragraph and additional formatting.</span></p>
but result from compare now is :
body style="font-family:'Times New Roman'; font-size:12pt"> div> <p style="margin-top:0pt; margin-bottom:0pt"> <span>Simple document with one paragraph and </span><del style="color:#b5082e; -aw-revision-author:'Parley Pro'; -aw-revision-datetime:'2020-12-29T19:35:36'"><span>no </span></del><span>additional formatting.</span> </p> <p style="margin-top:0pt; margin-bottom:0pt"> <span style="-aw-import:ignore"> </span> </p> div> body>
my code simple:
DocumentBuilder dbSource = new DocumentBuilder();
DocumentBuilder dbIncoming = new DocumentBuilder();
dbSource.insertHtml(source);
Document docSource = dbSource.getDocument();
dbIncoming.insertHtml(incoming);
Document docIncoming = dbIncoming.getDocument();
docSource.compare(docIncoming, “test”, new Date());
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions(SaveFormat.HTML);
htmlSaveOptions.setPrettyFormat(true);
htmlSaveOptions.setExportListLabels(ExportListLabels.AS_INLINE_TEXT);
htmlSaveOptions.setExportHeadersFootersMode(ExportHeadersFootersMode.NONE);
htmlSaveOptions.setExportImagesAsBase64(true);
htmlSaveOptions.setScaleImageToShapeSize(false);
htmlSaveOptions.setExportRoundtripInformation(true);
String result = docSource.toString(htmlSaveOptions);
So question why font and size moved to body? And can render html like before?
on version 20.6
<body>
<div>
<p style="margin-top:0pt; margin-bottom:0pt; font-size:12pt">
<span style="font-family:'Times New Roman'">Simple document with one paragraph and </span><del style="color:#b5082e; -aw-revision-author:'Parley Pro'; -aw-revision-datetime:'2020-12-29T19:54:01'"><span style="font-family:'Times New Roman'">no </span></del><span style="font-family:'Times New Roman'">additional formatting.</span>
</p>
<p style="margin-top:0pt; margin-bottom:0pt; font-size:12pt">
<span style="font-family:'Times New Roman'; -aw-import:ignore"> </span>
</p>
</div>
</body>