WPF Document Production Best Practices
I have a WPF application that captures various bits of information. At some point the user will need to generate a letter using a specified template and adding custom content. So far my application merges data capture with the document template (MS Word 2007) and launches the merged document so that the user can then print, save etc using Word.
I now have the need to extend this so that the application keeps a copy of the document printed.
What best practices can you suggest for how I sh开发者_JS百科ould implement the new functionality summarised as:
- System owned template
- Template must be able to be produced by an end user
- System merged values
- Manual additional user content
- Saved file should be saved back in WPF application
So far my options considered have been:
- Embed Word in my application
- Develop a Word 2007 add in that will save back to my application
I would drop word support entirely, and roll out my own editor which would save the data to the database (as opposed to providing the user a save file dialog).
Read this article for more helpful tips on building a text editor: http://www.c-sharpcorner.com/uploadfile/scottlysle/wordprocessor02042007234628pm/wordprocessor.aspx
You could certainly extend Word to accomplish what you need. Using the xml toolkit (link text extending and merging data into a Word form is easy.
Certainly a lot better than in days gone by, plus the processing is quick.
If the end users, mostly add text, and move tags around this can be done easily. If the users adds new tags that would be a lot more difficult.
You might want to look into Infopath (esp if you have a Sharepoint box sitting somewhere). Infopath was created to do most of what you ask.
精彩评论