We’re using Aspose 10.4.0. (java) on a windows 2008 server.
When a document is merged some of the merged fields do not have the original font anymore. In the example documents the template has TheSans Basic as font. After the merge the result.doc (see attachment) has text from which the font is changed to Times New Roman.
The template (see attachment) document has fields (eg Client_Geslacht) with a function to do some processing. The merge fields AFTER this particular field have their fonts changed. I’m not sure if it has anything to do with it, but it could be a start to find the problem.
Thank you in advance,
Ischa
P.S. I’m aware that the function is not necessary since we’re using Aspose, but this is part of a migration where the template documents are not to be changed.
Hi
Thank you for additional information. This problem cannot be related to fonts. It seems there is something wrong in your code. Have you tried running my code on your side?
Best regards,
I just tried with your code and checked my own code. I found the difference and the cause of the problem. We use a IFieldMergingCallback implementation to do some HTML stuff. We always insert the merge values as HTML (DocumentBuilder.insertHtml()) regardless of the value does actually contain HTML. But if the value does not contain any HTML it is treated as plain text (I think) and loses its original format. Which is valid in my opinion. So the problem is in our code. Thank you for your time.