I’m using Aspose to have a input.doc “template file” where I set my “Normal” style the way I like (for example, setting to Arial and alignment justified. My app reads this file, does some insertHTML to it and exports to a new “output” file.
The problem is that the text is correctly set to the “Normal” style and the font is correct but the alignment is not applied correctly. If I open my output file and re-set the style to “Normal” the alignment is corrected (justified).
What’s the problem that is going on and is there any workaround / fix for this?
This is really a crucial feature for my client that already paid for Aspose.Words…
thanks for the reply.
I didn’t test your fix but anyway I noticed that this doesn’t fix my problem because I noticed that my “if (par.getParagraphFormat().getStyle().getName() == “Normal”)” isn’t enough.
In my input template file I have paragraphs that still report having the “Normal” style (maybe as a base) and then have custom styling: right alignment, bigger font, different font type, etc, but still their style name is the “Normal”.
So this means your code changes all the paragraphs, instead of only the inserted paragraphs in the “insertHTML” statement.
Any way to achieve this?
Also, can you check if this bug still happens in your current trunk code? Because I still think this is a bug that should be fixed… don’t you agree?
Hi Paulo,
Thanks for your inquiry.
Yes from what it appears this is a bug, it happens in the .NET version of Aspose.Words as well. I have logged this issue and you will be informed when it’s fixed.
In the mean time you can use a work around like below which will insert the HTML with proper formatting and alignment without the risk of changing the formatting of any other paragraphs.
Thanks for the inquiry. Unfortunately, your issues is pending for analysis. Once our developers analyze this issue, we will be able to provide you an estimate. You will be notify as soon as it is fixed. Sorry for inconvenience.