A C# library for generating PDF documents from strongly-typed, fluent code instead of HTML-to-PDF conversion.
johnfercher/maroto
A Go library for generating PDF documents using a Bootstrap-inspired grid of rows and columns, built on gofpdf.
- Stars
- 2,781
- Forks
- 261
- Open issues
- 66
- Last commit
- 16 days ago
What is it?
Maroto is a Go library for creating PDF files programmatically. Its layout model is inspired by Bootstrap: a page is composed of Rows, each Row contains Cols, and Cols hold components such as text, images, lines, and tables. This lets developers describe a document's structure in code without manually positioning every element.
The library handles pagination automatically, adding new pages when content exceeds the usable area. A header can be defined once and repeated on every new page, and it may contain rows, lines, or table lists. Maroto is built on top of gofpdf, which provides the underlying PDF rendering.
The project is at v2 and is installed with go get from the github.com/johnfercher/maroto/v2 module. The repository also includes a set of Markdown skill files that instruct AI coding agents on how to generate PDFs with Maroto.
Key features
- 01Lays out PDF content with a Bootstrap-style grid of rows and columns.
- 02Automatically adds pages when content overflows the usable area.
- 03Supports repeated page headers that can contain rows, lines, and tables.
- 04Built on gofpdf for PDF rendering.
- 05Includes agent skill files for AI coding assistants.
Use cases
- Generating invoices or reports from Go backend services.
- Producing printable tables and forms with headers repeated across pages.
- Letting AI coding agents produce PDF generation code with bundled instructions.
Quick start
- 1
Install the library with go get
go get github.com/johnfercher/maroto/v2@v2.4.4
Things to know
- Maroto is a PDF generation library, so it does not run as a standalone application.
- Built on gofpdf, which is an older PDF backend.
In collections
Topics
FAQ
- What is maroto?
- A Go library for generating PDF documents using a Bootstrap-inspired grid of rows and columns, built on gofpdf. Maroto is a Go library for creating PDF files programmatically. Its layout model is inspired by Bootstrap: a page is composed of Rows, each Row contains Cols, and Cols hold components such as text, images, lines, and tables. This lets developers describe a document's structure in code without manually positioning every element.
- Is maroto free to use? What license does it have?
- maroto is open source under the MIT license. Check the license terms before using it in commercial products.
- Is maroto still maintained?
- Actively maintained. The last commit to maroto was on Oct 22, 2026.
- What can I use maroto for?
- Generating invoices or reports from Go backend services. Producing printable tables and forms with headers repeated across pages. Letting AI coding agents produce PDF generation code with bundled instructions.
- How do I install maroto?
- Install the library with go get: go get github.com/johnfercher/maroto/v2@v2.4.4
- Where can I get maroto?
- The source code and installation instructions are on GitHub: https://github.com/johnfercher/maroto
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A SwiftUI grid container inspired by CSS Grid, supporting flexible, fixed and content-sized tracks, spanning, and explicit placement.
A pure PHP library for creating, reading and converting Word-style documents in OOXML, ODF, RTF, HTML and PDF formats.
A free, open-source Windows PDF editor with a built-in PDF 2.0 engine for viewing, annotating, OCR, merging, splitting, signing and more.
Core server of the Cozy personal cloud platform, serving installed web apps and exposing a REST API for documents, auth, email and jobs.
Express-inspired web framework for Go, built on the fasthttp engine, for writing REST APIs and web servers.