We ❤️ Open Source
A community education resource
Automatically generate beautifully styled PDF files for contracts, approval notices, and project orders
Learn how to quickly and easily create PDF documents with OpenProject.
Successful teams always challenge the status quo and seek improvements. Top performers focus on high-value activities that contribute to project success—they avoid repetitive low-value tasks and invest their time in automation instead. They feel frustrated when they have to waste time identifying the latest version of a document. These individuals are irritated when they need to manually adjust styles in MS Word documents.
At OpenProject, we are passionate about automation. We dedicate all our energy and time to enhancing OpenProject, which means automating all repetitive tasks. It’s a pleasure to make these automation functions available to all OpenProject users.
This motivation led us to develop the automatic generation of PDF reports as part of the openDesk initiative in 2023.
The feedback from our users has been overwhelmingly positive, so we decided to invest further in this area.
We are currently developing a feature that allows teams to automatically create contracts, formal approval notices, and project orders.
Separation of content from styling
The inherent issue with MS Word or LibreOffice Writer is their flexibility and extensive formatting options. Ensuring consistent styling across multiple documents can be a lot of work, leading skilled professionals to waste valuable time harmonizing styles.
One solution to this problem is to use content editors and markup languages such as CommonMark. The idea is to provide authors with a standardized set of notations used to annotate a plain-text document’s content, offering information on the structure of the text or instructions on how it should be displayed.
These markup languages are widely used for blogging, documentation, and collaborative text creation—this blog article, for instance, is written in Markdown. The advantage is that authors can focus on content without worrying about formatting, as styling is handled separately in style sheets. This centralizes all styling information in one place.
Establishing a single source of truth
Having a single source of truth is crucial for process automation. All development activities in OpenProject revolve around this principle, whether it’s time tracking, dynamic meetings, or sharing work packages.
To automate the creation of project artifacts, we first considered how to establish a single source of truth. To establish a single source of truth we identified four key levels:
Single source of truth | Mapping | Example | |
---|---|---|---|
1 | Content template | Default description texts for work packages types | NDA contract template |
2 | Text formatting and styling | Style sheets | Logo, font, colors, text formatting |
3 | Contract input parameters | Work package attributes added through macros | Parties or contract date |
4 | Status information | Work package status workflows | Manager that approved the contract |
Automatic creation of PDF files
In 2022, we open sourced the library md-to-pdf, which we internally used to automatically create PDF documents for the Data Processing Addendum (DPA).
We have now integrated the capabilities of this library with the collaborative features of work packages. This feature allows anyone to quickly and easily create PDF documents from work package descriptions. The input parameters are added through macros, so users only need to enter their input into the work package attributes.
Here is a screenshot of the current development status. The feature is still under development at the time of publishing this article, so changes may occur before its release:
And this is what the generated PDF looks like in the current development version:
Example: Create a contract
Suppose you want to quickly create a new Non-Disclosure Agreement (NDA) with a business partner.
All you need to do is create a new work package of the type NDA. Then enter the input parameters into the corresponding work package attributes. The entered attributes are automatically added to the work package description through macros such as:
workPackageValue:signature-date
workPackageValue:first-name
workPackageValue:last-name
workPackageValue:company
Click on “Generate PDF.” Voilà—the contract is ready to sign and can be sent to the business partner for signature.
Possible next steps
We are currently exploring several possibilities:
- Automatically storing the generated PDF files in cloud storage providers such as Nextcloud or SharePoint/OneDrive.
- Offering more configuration options for file-naming conventions.
- Adding form fields for e-signatures.
- Creating additional default styling templates with more advanced document structures.
- Providing more configuration options such as custom fonts.
Integrating with e-signature solutions.
What do you think?
Will this feature help you in your daily work? What else would you need to simplify the creation of project artifacts and legal documents? Please share your thoughts in this feature discussion.
If you’re already using OpenProject, stay tuned for upcoming releases where we will enable this feature.
More from We Love Open Source
- Why open source matters in your project management tool
- How to start with design in your open source project
- Free download: GitHub Copilot vs Codeium cheat sheet
- How to get involved with We Love Open Source
This article is adapted from “Beyond MS Word: Automatically generate beautifully styled pdf files for contracts, approval notices and project orders” by Niels Lindenthal, and is republished with permission from the author.
The opinions expressed on this website are those of each author, not of the author's employer or All Things Open/We Love Open Source.