A lot of the fields I need to reference in templates—addresses and company names especially—contain text such as ampersands that needs to be escaped. If I don't escape the text with "?html" I get an Unexpected Error, but this escapes rather too much (it escaped newlines, which is a problem... the tags are visible in the PDF). I'm also then forced to use it everywhere, as I have no way of knowing where else such characters may appear in the future.
I did some research and read about FreeMarker's "ftl" directive, particularly...
<#ftl output_format="XML" auto_esc=true>
...or...<#ftl output_format="XML">
...at the beginning of the template, but these too cause Unexpected Error. I'm at a loss as to how to proceed. Has anyone else solved this escaping problem?