Question

I am looking for recommendations on document templating modules for an application that I am creating.

The application is an online service for a specific type of stores. I won't go into details about the service, mainly because I think it is irrelevant in regards to the problem.

My problem is basically this. I want my customers to be able to create their own document templates for certain sales documents. By document templates I mean layout of manuals and invoices etc. I basically provide a JSON document with the information to be merged into the template.

The JSON document can both include per document information such as logo, addresses but also arrays of information that should be presented as lists with totals and sub totals. The templates should also be able to handle paging and differentiate between first, last, even and odd pages. If it can handle different formats such as A4 and Letter that would be awesome as well. If localisation is supported, you should be able to hear my scream of joy.

If I can get out of having to implement such a templating service myself, I would gladly pay for it. I am open to different approaches of creating the templates. If the templates need to be created by a professional or someone with knowledge of specific tools such as PhotoShop or other design tools, that isn't a showstopper. If I can create a set of perhaps 10 standard templates and then let customers pay for custom templates, possibly by going to a third party design bureau that is fine. Web browser editing is also an option.

I would prefer to be able to externalise this completely from my application so I have call this as a web service or a REST Api, either hosted by me or by a cloud partner. That also means that I am rather indifferent when it comes to the language this is implemented in.

The output format needs to be at least PDF.

I just don't know of any options out there that does this, and was hoping for suggestions from you guys.

Thanks, JP

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top