Your requirements look like a pretty amazing fit with Docmosis Cloud Services. It is a commercial cloud service to which you upload documents (normal doc or odt files with "Docmosis" plain text mark-up) to act as templates. Your applications then call the REST API to perform mail-merge, conversion (doc, pdf, odt, html, rtf etc) and delivery of documents (stream back, email, store to Amazon S3 or any combination).
As to other requirements you mentioned, Docmosis supports:
- different page sizes (A4, Letter, A3 etc) based on the template
- sections allowing odd/even pages, headers/footers etc
- templates can be added "on-the-fly" depending on what you want to allow your users to do and because they are in common formats anyone can create/modify with Word or OpenOffice
- data can be supplied in JSON or XML format
- images can be embedded as base64 encoded data
- data arrays are supported for expanding arbitrary content/tables/lists
- localization is supported for data (UTF-8) streams and by virtue of what you put in the "template" documents. The only thing not yet localized are error messages that Docmosis spits back.
A look at the resources page of the website will show you the documentation for the REST API and template guides, code examples and SDKs. Please note I work for the company that created Docmosis.
Hope that helps.