0

A real estate agent asked me to create a program to automate the process of generating rental agreement contracts. Basically the whole document is the same for most parties but only a couple of lines change (date, addresses, social security numbers, names, etc.).

Ideally they'd fill out a form with that information, press a button and then the contract is automatically generated.

I've worked with a few java libraries to create excel documents in the past but I was wondering what would be the best approach to create something like this? Probably doing a java GUI with the form to then export into word might be an overkill (considering that it needs to follow a template design with logos, specific fonts and size)? Or would programming a plugin for Word in VBA or C# be able to do the trick? Or maybe there is a simpler way that I haven't thought of yet.

Thanks again for you input!

Wilo Maldonado
  • 551
  • 2
  • 11
  • 22
  • I have done something similar with Docx4j (http://www.docx4java.org/trac/docx4j). I created .docx template and injected custom XML with data using this library. The result was perfect. – shobull Jan 20 '15 at 05:44
  • Maybe this answer can help you too http://stackoverflow.com/questions/15446805/how-to-create-a-new-word-from-template-with-docx4j – shobull Jan 20 '15 at 05:48
  • My overview of different approaches:- http://www.slideshare.net/plutext/document-generation-2012osdcsydney – JasonPlutext Jan 21 '15 at 06:44

3 Answers3

1

Mail merge? That's what i think first and foremost.

You can also use macro from other .doc processing software and use the macro like OpenOffice.

Reference.

atiquratik
  • 1,296
  • 3
  • 27
  • 34
0

We developed our own library and recently published it at GitHub: https://github.com/wte4j/wte4j. We are using word documents with content controls as templates. Feel free to have a look at it.

Zeldon
  • 1
0

You can use AceOffix to do this.

  1. Make the rental agreement contract template. insert bookmarks (such as: date, address, social security number, name, etc.) in template

  2. Call the method OpenDataRegion ("BookmarkName").Value= "XXXXXXX", to assign value to the bookmarks in the contract template

Note: AceOffix opens Word files in the client browser for online processing, so MS Office must be installed on the client computer.

RobC
  • 22,977
  • 20
  • 73
  • 80