Hey everyone! 👋
I've recently published the first version of Letter Generator, an open-source Java library I've been working on to make letter generation easier.
Generating letters might sound straightforward at first, but once you start dealing with different layouts, headers, footers, styling, dynamic content, and reusable templates, things can get complicated pretty quickly.
I wanted a way to create and customize letters without having to worry about all those details every time. Something flexible enough to handle both simple letters and more complex ones, while keeping the process as straightforward as possible.
That's how Letter Generator came about.
What does it support?
The library has grown to support quite a few things:
Different ways to create letters: You can use a Fluent Java API, immutable Java models, JSON, or HTML templates, depending on what works best for your project.
Custom styling: Fonts, colors, themes, and company stationery.
Document layouts: Headers, footers, tables, images, signatures, watermarks, and automatic pagination.
Localization: Formatting dates, numbers, and currencies based on locale.
Reusable components: Define common styles and document elements once and reuse them across different letters.
It works with Java 17+, doesn't depend on any particular framework, and is already available on Maven Central.
Documentation and examples
I also spent some time putting together a documentation website using Astro Starlight.
It covers getting started, the different ways of creating letters, configuration options, and more advanced features. There's also a gallery with generated PDFs, so you can see what the output actually looks like.
You can check everything out here:
🔗 Documentation: https://nunosilva-dev.github.io/letter-generator/
💻 GitHub: https://github.com/nunosilva-dev/letter-generator
📦 Maven Central: https://central.sonatype.com/artifact/io.github.nunosilva-dev/letter-generator/1.0.0
What's next?
This is the first public release (v1.0.0), and there's definitely room for improvements.
For now, I'm happy to finally have it published and available for anyone who might find it useful.
If you've worked with PDF generation in Java, I'd be interested to hear about your experience and whether there's anything you'd like to see supported.
Feel free to check out the repository, open an issue, or contribute if you're interested.
Thanks for reading!
Top comments (0)