Tool for building a reference guide website or document generator?
March 25, 2013 3:23 PM   Subscribe

Is there a word for these types of web-based tools, and a widely-used way to make them? One: a way make a web-based reference guide / glossary / help centre. Two: a tool that will generate a custom 20-page PDF based on complex user inputs, complete with table of contents. Are there open-source, well-supported solutions for building these things? Maybe a way to combine some plugins for Drupal or Wordpress? I really have no idea how to tackle this.

I have a client who has a unique need. I'm trying to figure out if I can provide what they're looking for, and if not, where I should point them. Let's call them a non-profit association (NPA). They support small member organizations (MO's) by providing legal counsel, and one of the legal services they provide is a toolkit for new non-profits to write their documents of incorporation and bylaws.

Currently this is a Word document that has all the legal language the MO needs, in several optional variations, with notes where they should cut and paste things or customize. The user (MO member, usually not computer-savvy) has to cut and paste this Word document into a new Word document and then figure out how to generate a new table of contents and change the text to reference that new table of contents. This is required because often the text says things like "(when such and such happens) see bylaw 2a subsection 3 (but if such and such doesn't happen) see bylaw 3c subsection 1," so numbering needs to be consistent. The process often goes badly and the MO has to send their document back to the NPA to be cleaned up and fixed, which creates a lot of work

The current Word document also comes with a reference guide which explains legal terms and bylaw implications. Currently this guide is produced as a static PDF or printed booklet.

The NPA has a vision of this all happening online, in a more controlled way. They want the guide to be an interactive help centre, linked directly to the working document. So as the user is working on selecting their bylaws, they could click on a term and go to a web page with a definition, or see a pop-up with an explanation. Furthermore, the NPA would like to have more control over the final document, ideally they'd like PDF output based on a limited number of choices, rather than a Word Doc. The process is complex enough that the user should be able to save their work and come back later, rather than doing it all in one sitting. The MO's already all have logins to the NPA's (Drupal-based) site where they access the downloadable resources, so Drupal makes sense as a starting place. Any ideas about how to tackle this with existing tools? Are they looking at paying $50k for a complete custom web app? Or is this just plain too big to tackle, and they should put the money towards hiring a bunch of legal assistants to deal with the workload from the current system?
posted by 100kb to Computers & Internet (8 answers total)
It's certainly possible but whether it's $50k or not will mostly depend on the complexity of the logic for toggling parts of your word processor files (your "complex user inputs"), and whether you want a generic solution that processes arbitrary legal documents or if you just want one for incorporation and bylaws. Without knowing the detail of those features, or how many legal documents are involved in "bylaws" it's difficult to say whether your budget is appropriate or not.

I've written a few legal document generators over the years (I wrote Docvert to process office files) and typically people script a server (headless) version of LibreOffice. The reason for this is because you can't use Microsoft Office programmatically for a CAL-less user without violating the EULA.

The basic architecture is that most people dynamically generate OpenDocument files based on answers to a web form (in Drupal or anything) and then script LibreOffice (via UNO in Python or Java) to export PDFs or Word files. The good thing about using a word processor format like OpenDocument (as opposed to XSL-FO or another lower-level PDF generator) is that you get the formatting you'd expect from a word processor, with TOC , line number references, bookmarks, and so on.

It sounds like you need to write an RFP to see whether your budget is realistic or not.
posted by holloway at 3:44 PM on March 25, 2013

Response by poster: Oh sorry, a clarification: in this ideal setup, there would be no Word Docs involved anymore: the user would fill out a web form and download a PDF. On the backend, NPA staff would have some sort of content management system to update the legal text and move around variables.
posted by 100kb at 3:47 PM on March 25, 2013

I understand and I'm answering the bit about "tackle this with existing tools" by suggesting a basic software architecture. These types of legal document generators typically use word processor files (as an intermediate format) even if the user only sees PDFs.

If you're just asking whether it's possible then yes there are many sites like and that do this. Drupal also has many PDF generators like Views PDF. It can be as simple as generating HTML if you have simple requirements.

...but ignore the PDF document generation for a second and it's like you're asking "I want to build a website with complex forms that make pages and I want to pay about $50k is that realistic?". That's just not enough information to go on... I'm not meaning to be harsh by saying that and I'm only meaning to convey that I don't know how we can answer your question without knowing how many documents, and how complex they are :)
posted by holloway at 4:15 PM on March 25, 2013

Response by poster: I think the $50k is bit of a red herring, as I just threw that out there as an example of how much a custom web app could cost. They don't want to build a custom web app if they can avoid it. The actual budget of the client in question is much, much lower: under $10k, ideally under $5k. And I am the developer who would be possibly implementing the tool. I do Wordpress/Drupal theming and install, but I don't do custom web apps, so my question is an attempt to scope whether this project is within my skillset and the client's budget for my time. If they wanted a social networking site, for example, I'd set them up with BuddyPress and that'd be under $5k. But I've never made a thing like this, and I am having no luck looking in the places I usually look.

So I'm not as much asking "is this website possible under $50k?" as "are there existing, open-source, well-documented tools to do this, or should I tell them I can't do it and they can't afford it?"
posted by 100kb at 4:34 PM on March 25, 2013

I think this is possible within their budget by creating a userform, which is a VBA form that displays in Word and the ultimate output would be Word. I do see you are not interested in Word, but that would keep it within their budget.
posted by Houstonian at 5:07 PM on March 25, 2013

For part of your question, you may want to check out TCPDF. It's an open source PHP class for making PDFs. There's a bunch of examples on their site and supposedly there are plugins for Drupal and Joomla. The hard part of the project will be figuring out how to translate your Word content into something that is user-selectable and works with this PDF class (but that is beyond my expertise).
posted by FreezBoy at 5:08 PM on March 25, 2013 [1 favorite]

Yes TCPDF is used in the Drupal plugin I linked above. A PHP library for making PDFs isn't the difficult bit here unfortunately.

@Houstonian they want something like a Drupal addon for the public to use.
posted by holloway at 8:23 PM on March 25, 2013

Important to note that web standards support for styling of print are rapidly evolving right now as new CSS3 features are being added by the browser vendors from month to month. So, a solution could generate a web page that will print correctly in one specific browser (for starters, though being cross-browser would be ideal of course) and simply print to PDF.

Though holloway probably has a better grasp of whether the specific requirements of generating legal documents would be met even by fully-implemented web standards.

For "open-source, well-supported solutions" you probably couldn't do better than industry-standardized cross-vendor support of the print layout mechanism, similar to the benefits he describes for using a standardized open source word processor format. I'm just thinking that a completely web-based system, like an open source wiki that supports transclusion such as MediaWiki or JAMWiki where you can break content down into arbitrarily small pieces and each one will have its own talk page, change history, access rights, etc., might be a better fit for some of the other requirements.

(Overall, however, it might serve you best to put the majority of resources devoted to the project into nailing down and documenting a consistent workflow and procedures, as well as training for the MO personnel involving web videos and other reusable self-service materials, regardless of which technological solution you arrive at.)
posted by XMLicious at 12:15 AM on March 26, 2013

« Older Resources for healing from domestic violence?   |   Find my perfect bag, version 478... the diaper bag... Newer »
This thread is closed to new comments.