-
Notifications
You must be signed in to change notification settings - Fork 91
Frequently Asked Questions
Tom Hombergs edited this page Jan 1, 2016
·
5 revisions
Probably because you're providing replacement strings that are not UTF8 encoded, for example if the replacement string in your context object is defined as String variable in a ISO-8859-1 encoded java source file. The solution to this problem is to make sure that all your replacement strings come from an UTF8 encoded source. Other encodings are not supported by the Office Open XML standard.
By default, Date objects are formatted "dd.MM.yyyy" when an expression in the template is replaced by a Date. You can change this behavior by simply registering a new DateResolver with your own formatting String, for examle "yyyy-MM-dd HH:mm":
DocxStamper stamper = new DocxStamper();
stamper.getTypeResolverRegistry()
.registerTypeResolver(new DateResolver("yyyy-MM-dd HH:mm"));