We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Font Size issues when doing word mail merge

Very basic mail merge that we used to do using Word interop. Merge fields defined in the template and data is merged using a data file that is created on the fly. In my development setup, everything merges properly and the output document looks fine. When the template was moved to TEST (a different domain), the document produced there have a mixed font sizes. I checked all template objects including the merge fields and all have Tahoma 10. But in the document produced in the TEST domain, some of the fields (including static text) have changed to Tahoma 12 and this causes lines to wrap and extra pages to generate etc. Is there something that can be done to prevent the font sizes from changing? My feeling is it could be something with the normal.dot in the TEST Office installation. But since I don’t have access to that, I cannot be sure. The version of office that we use is MS Office 2010. Any hints or suggestions?


Thanks,

Aravind

Aspose.Words version info:

File Version: 15.12.0.0
Product Version: 2015.12.31

Hi Aravind,

Thanks for your inquiry. If you are saving final document to Pdf, please note that Aspose.Words requires TrueType fonts when rendering documents to fixed-page formats (JPEG, PNG, PDF or XPS). You need to install fonts on the machine where you're converting documents to Pdf.

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document
  • Please attach the output document that shows the undesired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we'll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click 'Reply' button that will bring you to the 'reply page' and there at the bottom you can include any attachments with that post by clicking the 'Add/Update' button.

Thanks for the reply. The document is not saved to PDF. Just to a docx format. The problem is I cannot repeat the issue in my DEV workstation with the same template and code. It only happens in our TEST environment. My initial feeling was it may have to do with the Normal.dot on the TEST workstation but I think it may be related to styles.

I tried to re-create the template from scratch but still have the problem. It would have been easier if I could just recreate the issue in DEV.

When I changed the template font from Tahoma to Arial, it still increases the size by 2 sizes in our TEST environment. I then changed the template back to Tahoma font but increased the size from 10 to 12 and it renders it ok then (but our Company standard is Tahoma Size 10 for all correspondence documents). It appears that Aspose is not able render size 10 for some reason? This template has not changed for over an year and has worked fine when we were using Word Interop to generate the correspondence document. We are in the process of converting to Aspose.NET for Words but running into this issue. The only thing that I noticed is the version of MS Word in DEV and TEST are slightly different.

In DEV it is: 14.0.7153.5000 (32-bit)
In TEST it is: 14.0.7116.5000 (32-bit)
In PROD it is: 14.0.7113.5000 (32-bit)

We resolved the issue. It was an issue with the Normal.dotx in the TEST environment. Replacing it with the one from the DEV environment appears to fix the issue. But still not sure why Word Interop did not show this issue, whereas Aspose did.

Hi Aravind,

Thanks for your feedback. It is nice to hear from you that you have resolved your problem. You may check the attached template to the document using Document.AttachedTemplate property. Your template document must be same at your test, development and production envionment. You can also use Document.AttachedTemplate property to attach the template to document. If value of Document.AttachedTemplate is empty string, its mean that the document is attached to the Normal template.

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.