Repolode
johnfercher

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. 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