Thanks for your request. Sure you can, you can try using embedded or external CSS to achieve this:
Also, you can call JoinRunsWithSameFormatign method to reduce number of runs:
Hope this helps.
Thanks for the quick reply. This does look useful.
I am using Aspose.Words jdk 15, am I correct in thinking that the HtmlSaveOptions class which contains the CSS options you described is not part of this version? Would I have to upgrade to get it?
Thanks for your request. jdk 1.5 is not a version of Aspose.Words library, but the version of JDK it is built for. To check version of Aspose.Words for Java you should unzip Aspose.Words.jdkXX.jar, open META-INF\ MANIFEST.MF file in notepad, you will see the following:
Specification-Title: Aspose.Words for Java
Implementation-Title: Aspose.Words for Java
Specification-Vendor: Aspose Pty Ltd
Implementation-Vendor: Aspose Pty Ltd
Copyright: Copyright 2003-2009 Aspose Pty Ltd
HtmlSaveOptions was added starting from 10.0.0 version of Aspose.Words.
I see, thanks Alexey.
I am using an earlier version of Aspose.Words so I guess I will not have access to that feature.
I tried it on a trial version of the newest Aspose.Words release and using the HtmlSaveOptions embedded CSS mode did reduce the size of the document by much there were still many repeated style definitions which made the document quite large (around 15000 characters rather than the 17000 it was before)
Thanks for your request. Unfortunately, there is no way to further reduce size of generated HTML.
However, if you need to control how the document is exported to HTML, you can try creating your own HTML converter. You can use the same approach as suggested here:
In this case, you can export only simple HTML.