Hi,
in aspose-words 20.1 there is still this problem with the centering of images.
We use TinyMCE and a centered image is inserted like
<img style="display: block; margin-left: auto; margin-right: auto;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAlCAIAAAClPtxqAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA2SURBVFhH7c0xDQAgEAAxhPz4/p3hARMXpibde+7sN7KELCFLyBKyhCwhS8gSsoQsIUvIArMPY2Aef7T6lhYAAAAASUVORK5CYII=" alt="red.png">
in IE, FF, Chrom the image is displayed centered. But the pdf output from aspose places the image left aligned.
I know this problem is a really old one but is there a chance that it will be fixed in aspose ?
Here the code:
val tempPdfFile = folder.newFile()
val doc = Document();
val builder = DocumentBuilder(doc);
val htmlWithTinyMceCenteredImg =
"""<img style="display: block; margin-left: auto; margin-right: auto;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAlCAIAAAClPtxqAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA2SURBVFhH7c0xDQAgEAAxhPz4/p3hARMXpibde+7sN7KELCFLyBKyhCwhS8gSsoQsIUvIArMPY2Aef7T6lhYAAAAASUVORK5CYII=" alt="red.png">"""
builder.insertHtml(htmlWithTinyMceCenteredImg)
doc.save(tempPdfFile.path, PdfSaveOptions())
Thank you!