The company that I work for just recently purchased the developer version of Aspose.Word based on my say so, even though I had problems with some font/size issues with the trial version. So I am desperately looking for answers/ideas as to what I’m doing wrong or how I can work around my problem.
The problem is that the bookmarked fields and non-fillin and non-merge fields (System fields accessed from Insert>Field…> menu such as DateTime fields) are not keeping their format (existing in the template) when being programmatically filled.
Here’s a code snippet of what I’m doing:
//designer variables
FileStream fs = new FileStream(filename, FileMode.Open);
Aspose.Word.Document doc = new Aspose.Word.Document(fs);
This is essentiall all I am doing, although simplified quite a bit because I am using arraylists for bookmarks and data.
I really don’t think I am doing anything special. Most of the body of the document, the bookmarked fields are Tahoma 11pt. In the top header we have Tahoma 8pt size. If I were to change the font size of the first charater in the document represented by the OLogo bookmark to say 14pt, the generated document will have all the aforementioned bookmark fields become 14pt. I have included the Aspose.Word generated document in this post and will include the orginal document template document in a following post.
I hope you can shed some light to my situation and look forward to your prompt response. Thank you.
Almost there. I am still having some issues with font/size issue in some documents. I particularly notice the problem is when a particular bookmark is say 8pt (see header) and the next character, whether it’s an end-of-cell or new paragraph character, is set to a font of size 11pt, the resulting bookmark will be programmatically filled with the 11pt size which is not what I wanted.
It is an easy fix for one document or two. But I may have to change this on 500+ documents.
I hope you guys can come up with another update that will solve this problem. You haven’t let me down yet.
Look forward to your expedient responses.
Thank you.
Paulo Fuh
ORTICON
PS I attached a new generated document and will post the original template too.